Jump to content

Hyperlynx

Members
  • Posts

    55
  • Joined

  • Last visited

Everything posted by Hyperlynx

  1. I've thought of maybe doing that. The tricky part would be how often to sample. Maybe I could do a bunch of flights to gather data on what a good trajectory looks like and then hope it fits into a mathematical curve that I can easily work out?... I'll give that pdf a read. Thanks! My TWR ranges between 1.3 and 1.5, grav turn speed between 80 and 100, turn angle 1 to 10, time before ap burn 30 to 15. Getting the right number within those ranges is what's annoying, particularly because I'm trying to get as close to optimal (circular) as I can/have the patience for, to save on the cost of the rocket. But I should try the lock to 45 degrees thing, it's probably going to be more consistent. That's a good point! I could use that to work out the proper burn duration!
  2. I've been playing KSP for a while now, on and off (Steam says >350 hours). But yet, getting into orbit is still trial-and-error for me. I use Kerbal OS. For each spacecraft I design, I write a script to launch it. The script is roughly the same each time: Lock throttle to <target TWR> When at <gravity turn speed>, pitch to <angle> degrees from vertical. Wait 10 seconds. Unlock steering. Wait until apoapsis has reached <target apoapsis>. Cut throttle. Wait until <seconds before apoapsis> Throttle to 100% Wait until periapsis has reached <target periapsis> What changes is the values of those variables (in <angle brackets>). The thing is, changing those variables is completely trial-and-error. I can tell from experience how each one is going to affect my orbit. If I'm at a higher speed before I start my gravity turn then the pitch-over is going to be slower and higher, and I'll have to burn longer to circularise, but if it's too low then I'll pitch over too fast and won't reach space. Similar story with TWR - too low and I don't go to space, too high and I waste fuel due to air pressure. But finding the *right* numbers to use seems to be just keep trying and trying and trying until eventually I get into a nice, relatively circular orbit. Surely there must be a better way to do this than trial-and-error hardcoded values. How can I work this stuff out beforehand? Or is there another algorithm I should use instead?
  3. I have a launch script that works. I'm trying to convert it to put the launching part in a function, called by a button click. However, when I click the button my ship stages but doesn't throttle up. What's going on? @LAZYGLOBAL OFF. //flight parameters //Note: these must be global, or the locks won't work global targetApoapsis to 71000. global targetPeriapsis to 70000. global targetTWR to 1.5. global gravTurnSpeed to 90. global gravTurnAngle to 4. global timeBeforeApoapsis to 30. ///////////////////////////// SAS OFF. LOCAL preflightGUI IS GUI(200). LOCAL launchButton TO preflightGUI:ADDBUTTON("Launch"). set launchButton:ONCLICK to launch@. LOCAL closeButton TO preflightGUI:ADDBUTTON("Close"). preflightGUI:SHOW(). until closeButton:TAKEPRESS { // button still isn't pressed yet, let's keep waiting. wait 0. } function launch { preflightGUI:HIDE(). print targetApoapsis. print targetTWR. stage. //lock throttle to the target thrust-to-weight ratio: global lock distance to SHIP:ALTITUDE + BODY("Kerbin"):RADIUS. global lock weight to CONSTANT():G * ((SHIP:MASS* BODY("Kerbin"):MASS) / ( distance * distance )). lock THROTTLE to (targetTWR * weight) / (SHIP:MAXTHRUST + 0.001). lock steering to up + R(0, 0, 270). print "Ascending". wait until SHIP:VERTICALSPEED > gravTurnSpeed. lock steering to up + R(0, -gravTurnAngle, 270). print "Gravity turn". wait 10. // surface prograde lock steering to R(0,0,0) + velocity:surface. // when high enough, go hell-for-leather for orbital prograde. when ship:altitude > 27000 then { lock steering to ship:prograde. set targetTWR to 100. } when ship:maxthrust < 0.01 then { stage. when ship:maxthrust < 0.01 then { //don't thrust into the next stage, or it will explode and knock the craft off course lock throttle to 0. //wait for engine to stop declare global waitTime is TIME:SECONDS + 0.25. when TIME:SECONDS >= waitTime then { stage. set waitTime to TIME:SECONDS + 1. when TIME:SECONDS >= waitTime then { lock throttle to (targetTWR * weight) / (SHIP:MAXTHRUST + 0.001). } } } } print "Waiting until target apoapsis". wait until SHIP:APOAPSIS >= targetApoapsis. lock throttle to 0. print "Done". }
  4. Hm. Is there any way to set up different script directories for different saved games? I have my scripts under Git source control, and would rather like to do that with my ship designs as well, in the one repo. I usually have a craft and a script to launch and operate that craft, but the crafts are stored per save and the scripts are stored globally, at least by default. I guess as a workaround I can have the repo be in ksp/saves/savename/Ships and softlink a scripts directory to the ksp/Ships/Script directory. I just tried putting a subdirectory in boot, with the idea of having each save use a different subdir, but the contents was not recognised. I guess I'll need to append a namespace to my scripts' filenames, if I want to keep them from conflicting across saves. Not the end of the world, though, seeing as I'm probably not going to end up running two saves at the same time.
  5. Aha! So my problem was just that I didn't know how to read the info in CKAN properly, and I actually didn't have v1.1.5.2 when I thought I did. It's all good now
  6. Oh whoops, I didn't realise you were the OP. Of course, it must be something at my end. I'll track down the logs...
  7. You misunderstand - I have the 1.4.1 version, but it's not working. I can put the kOS part on my craft, and old designs using it still work, but right-clicking on it doesn't give me the button to open the console. I also don't have a kOS icon on my toolbar, like I used to.
  8. Hey, I've just started playing KSP again after a long hiatus. kOS doesn't seem to be working for me any more. Are you all playing on KSP v1.4.1? I'm on 1.4.2 due to Steam patching my game whether I like it or not. Am I missing something about how to get it working, or do I just need to wait for an update?
  9. Thanks guys! It works perfectly. The finished code: set stageTwoTWR to 1.3. //... set targetTWR to stageTwoTWR. lock distance to SHIP:ALTITUDE + BODY("Kerbin"):RADIUS. lock weight to CONSTANT():G * ((SHIP:MASS* BODY("Kerbin"):MASS) / ( distance * distance )). lock THROTTLE to (targetTWR * weight) / (SHIP:MAXTHRUST + 0.001).
  10. FancyMouse: I was under the impression that the formula for gravity was the acceleration under gravity, not the weight due to gravity. Not so? Reddeyfish: the force of gravity is based on the mass of both bodies, though. Granted my ship's mass is infintesimal compared to Kerbin, but it still contributes. Have I got my formula for gravity wrong?
  11. I'm trying to calculate my spacecraft's weight, so I can keep my TWR constant. I've managed to get my thrust-to-MASS constant, but I'm having a lot of trouble trying to calculate my weight. From what I understand, weight = gravity * mass, and gravity = G * (mass[craft] * mass[kerbin])/distance^2. However, I can't get correct results out of kOS. Here's what I'm trying so far: lock distance to SHIP:ALTITUDE + BODY("Kerbin"):RADIUS. lock gravity to CONSTANT():G * ((SHIP:MASS* BODY("Kerbin"):MASS * 1000) / ( distance * distance )). lock weight to (SHIP:MASS) * gravity. print "distance:" + distance. print "grav:" + gravity. print "weight:" + weight. kOS returns SHIP:MASS in metric tons, not kilograms, so I have multiplied by 1000 to get kg. The craft has a mass of 2,779kg, however this gives the weight as 75,723kg! That's likely because it has gravity as 27,251 when, as far as I understand, it should be just 9.8. What am I doing wrong? I figure I have units crossed somewhere. Or does Kerbin have fixed gravity that differs from what it should have for its mass and size?
  12. The problem was definitely, totally that the solid boosters were slewing. Struts solved it.
  13. Aha! I spent the $75,000 for the astronaut complex upgrade, did some EVAs and spent the science on struts. Now that I've strutted up my boosters, things are MUCH better. Yes, I took that screenshot to show that I had found that problem. Unfortunately, it was not the only problem with my design. The main problem was that the radial decouplers were not keeping the boosters straight. Struts has fixed that problem.
  14. I don't yet have struts or multi-kerbal cockpits. Making do with pretty crap technology.
  15. Removing the SRBs and going with only a stick design I've managed to get a comms sat into space. Thanks capi, that's done the trick. (I'm using RemoteTech, so I need the com sat for low kerbin automated stuff)
  16. Thanks Streetwind, I'll try your advice. Those vertical fins on the SRBs are a recent addition; I was getting these problems almost regardless of fin configuration. I'll see how I go with the other details, though. Wolfox, I don't have those parts yet, so it's a no-go. e: no, it's still pitching to the right.... Oh. Well, that would do it. That probably wasn't helping my stability either! ee: no, it's still veering to the side. Can't work out why. I assume it must be asymmetrical in some way... eee: well, I had to have Jeb SAS the craft up, then SAS to prograde, but it's worked.
  17. I've played KSP for a fair while now. I started a new campaign when v1 came out, and now I just can't seem to build a rocket that gets to space. They all seem to be very unstable, with a tendency to turn end-over-end. NOTE: I am using the Ferram Aerospace Research mod, so it's not the stock aerodynamics model. I was using it before the v1 change and things seemed to be ok, but now I'm stumped. Basically, I'm not sure what I should be trying to do with my rocket design, and I'm not sure if my ascent profile is correct. Also, it seems to be very hard to actually fly my ascent profile correctly without the thing pitching over much too quickly, then flipping end-over-end. Here's a two-seater, intended to take tourists into orbit: ... after SRB separation: ... and second stage only: I've tried to keep the centre of lift behind the centre of mass. The only way I know how to do that is to add fins (which doesn't seem very rockety), and I think I've added them basically everywhere I can. As far as ascent profile goes, I'm trying to fly directly up until I hit 50-60m/s, then pitch over 5 degrees down facing east and let gravity do its thing. What ends up happening is the rocket strays off directly vertical unless I use SAS, and when pitched over to 5 degrees it pitches over further than that and I have to fight it to stay on course. After separation, all bets are off and I generally lose control of the rocket. I've thrust-limited each stage to around 1.3 TWR, and I'm limited the gimbal range to 25%. So... what am I doing wrong? What should I be looking for in the vehicle designer? How can I fix up my flight plan?
  18. I'm having problems with RemoteTech. Periodically it ignores directions to orient to prograde. Yes, I've checked that I still have signal to the ground and power. Possibly related with the other problem I'm having, which is that sometimes control inputs seem to stop doing anything (posted at http://forum.kerbalspaceprogram.com/threads/124497-Control-inputs-stop-working%21). Are there any known incompatibilities with any of the mods on this list?
  19. The thing is, it stops responding to RemoteTech commands as well. I switch to "orient to orbital prograde" and it just spins. I cancel commands and try to control it directly, and it still doesn't respond...
  20. My craft stop responding to control inputs all of a sudden. I press on the controls, I see the gauges change, and the vessel does not maneuver. Piloted aircraft I have previously designed and flown will refuse to take off when they ignore the pitch up control, and probes I've launched into the upper atmosphere will refuse to answer the RemoteTech autopilot instruction to orient to prograde AND refuse manual controls. The issue is intermittent. The probe I mentioned responded to the RemoteTech controls to get up to around 40-50km, the navball switched from surface to orbital, and then it ignored all inputs. I checked, and there was still plenty of electric charge and I still had RemoteTech signal back to KSC. I have recently deleted and reinstalled all my mods using CKAN to cure another bug. Mods installed: I suspect the problem might be Ferram Aerospace. It seemed to be the cause of my previous problem, which was the screen going blank with the UI present and the velocity pegged at NaN. I tried to get it working again by reinstalling everything, and now I get this bug... Also, when I start up, I get an "Incomatible Mods Detected" message, flagging "KSPAPIExtensions". I have updated all my mods using CKAN, so I don't know what this is on about... - - - Updated - - - Actually, probe goes out of control when I stage to the second-to-last stage. Again, I still have RemoteTech link and resources, so it's not pilot error
  21. Question: how can I get how fast my vessel is currently rotating? As in, if I'm out in space and the vessel is spinning on its centreline, is there a variable I can call that will tell me what my speed of rotation is? Yes, it works with RemoteTech. I think there's an option in the config you have to set though (but that might just be in older versions).
  22. Well, given that Kerbal Space Program is a work of fiction, in part shaped by modders like Nereid, we have the opportunity to to tell a story different from Earth's history. KSP's already seeing some use in schools, inspiring the new generation of space nuts. If we have the opportunity to contribute to steering them towards equality, I think we should take it. Valentina Kerman is as much a BadS as Jebediah, after all.
×
×
  • Create New...