Ozin
Members-
Posts
20 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by Ozin
-
[1.8.x-1.12.x] kOS addons: StockCamera, EVA, SCANSat, Career
Ozin replied to JonnyOThan's topic in KSP1 Mod Releases
Thank you so much for maintaining and posting these! -
Hi, first of all thanks for keeping this great little mode maintained! I've been having an issue for a long time with the shadows going crazy whenever any of the cameras in this mod are active, and it's driving my slightly crazy. I took a recording of it, you can see how the shadow kind of z fights and flickers on all of the buildings and runway (even where there shouldn't really be any shadows): I'm wondering if anyone else has experienced this issue, and if anyone have any suggestions on where I should start looking for potential fixes to this problem. This was recorded in KSP 1.3, and with one of the compatible HullcamVDSContinued versions. I removed scatterer and reshade and can't think of any other mods that would interfere with this mod. Thanks edit: I've tried patching KSP to 1.3.1 and only installing this mod and the same issue remains. Also tried forcing opengl but same result. edit 2: After digging around in the code and changing the KSPField "cameraClip" from the default 0.01 to 0.10+ my issue was fixed. Feels good
-
Ah yeah, going from manual to automatic kind of screws it up at the moment. I'll take a look at it, need to play around with the controller anyways. Glad you found it useful. Oh it shouldn't be hard to add support for multiple propellers I think. Same with toggling the blades to max and min pitch (if I understood your suggestions correctly)
-
In your case (I assume you haven't used kOS before) it would be sufficient to backup your save folder, as your script folder is empty. It should be fairly stable though, there have been no reports of any data being lost or corrupted for the last month. But of course it never hurts to be on the safe side Hopefully the stable version of kOS 1.0 will be released soon.
-
Here is the first version of the program (unzip into main game folder). Would you mind taking it for a spin and give me some feedback? What you need: Download and install kOS 1.0.0-pre-1 In the SPH editor, find the kOS parts in the Control section. Add a kOS part of your choice to the plane, add another to the element that will become the propeller vessel. Right click the CPU on the plane and set the boot file to "boot_plane.ks" Right click the CPU on the propeller and set the boot file to "boot_propeller.ks" Right click on any part on the propeller (preferably one with a low risk of disassembling) and select the name tag option. Add this nametag: `propeller`. Launch the vessel and press the actiongroup 1 button to have the script activate and automatically undock (no need to add undock/decouple to actions/staging). The rest of the commands are listed at the top of the kOS terminal window. There is no need to switch to the propeller vessel in either automatic or manual mode. A video of it in action:
-
Hey. I'm working on a kOS program that automatically adjusts all propeller blades/controlsurfaces' authority limiters to maintain a target angular velocity. I already have the basics working, as listed here https://www.reddit.com/r/KerbalSpaceProgram/comments/4wjsac/first_flight_around_kerbin_in_a_stock_turboprop/d67tv02 . But since I'm new to this branch of krakentech I was wondering what else would be needed to make it work for most of your designs. Should the user be able to set a max and min value for the limiters or is -150 to 150 okay? Would an additional throttle limiter be useful?
-
[1.3] kOS Scriptable Autopilot System v1.1.3.0
Ozin replied to erendrake's topic in KSP1 Mod Releases
I made a quad-engine drone program for kOS kOS reddit thread (download including script and example crafts + instructions) -
Can't you just wrap the program into an until block? set manualAbort to 0. until maxthrust = 0 OR manualAbort = 1 { (looping program) }. edit: for a non looping program you could do this if maxthrust = 0 { print "ABORTING PROGRAM: No active engines right now.". print "Do not run until after you've started up the engines.". ...Crud what goes here? break? abort?... }. if maxthrust > 0 { ... rest of program continues on from here. }.
-
You can find some script from users in this thread: http://forum.kerbalspaceprogram.com/showthread.php/48428-Space-Computer-Brought-to-you-by-kOS-and-hopefully-many-nerds
-
Space Computer. Brought to you by kOS and hopefully many nerds.
Ozin replied to Payload's topic in Science & Spaceflight
Thanks, and yeah, here is a much improved version taking a different approach. No uneven or stuttering throttle in both directions now. If the rocket has to climb to reach the target height, it uses the "radar apoapsis" as the error rather than the actual height. For drops I tweaked the error to work with WTR. I left in some margins of error, could be made more aggressive/fuel preserving. Also works great with parachutes. Lowest TWR I tested it on was a 1.04 dropped from 12km (1.19 by the time it stopped at hover). Highest around 6.5 TWR. print "Hovering..". set radius to 600000. set g to 9.81. set offset to 20. set targetHeight to 1000 + offset. stage. sas off. lock steering to up + R(0,0,180). set I to 0. set deactivateFlag to 0. on AG9 set deactivateFlag to 1. set adjust to 0. set PI to 0. lock throttle to PI. until deactivateFlag=1 { set WTR to (mass*g*((radius/(radius+altitude))^2)/maxthrust). set radarApoapsis to apoapsis - (altitude - alt:radar). if verticalspeed < 0 { set radarApoapsis to alt:radar. }. if targetHeight < (radarApoapsis + offset - 10) { set error to ((targetHeight - radarApoapsis)/(20*(WTR^0.5))) - verticalspeed - 15. print error. }. if targetHeight > (radarApoapsis + offset - 10) { set error to (targetHeight - radarApoapsis) - (verticalspeed*3). }. set P to (0.02*(error))*WTR. set I to (0.03*(error + I))*WTR. set PI to P+I. on ag2 set adjust to 2. on ag3 set adjust to 3. on ag4 set adjust to 4. if adjust = 2 { set targetHeight to 3000 + offset. toggle ag2. set adjust to 0.}. if adjust = 3 { set targetHeight to 20 + offset. toggle ag3. set adjust to 0.}. if adjust = 4 { set targetHeight to targetHeight - 10. toggle ag4. set adjust to 0.}. }. unlock throttle. print "Exiting..". Compared to the last version, this performs a lot better. I'm really pleased with the result -
Space Computer. Brought to you by kOS and hopefully many nerds.
Ozin replied to Payload's topic in Science & Spaceflight
Personally I prefer the approach of getting as close as possible to a balanced thrust at a target height as efficiently/quickly as possible. It ends up being a lot more stable for me. True, the interval is increased with more calculations, but as long as it is stable the PI controller works very well. The prints were obviously for debugging. -
Space Computer. Brought to you by kOS and hopefully many nerds.
Ozin replied to Payload's topic in Science & Spaceflight
yeah same here. As soon as you put more into that loop it starts updating too slowly. Did you give my version posted on page 1 a try? It works perfectly for me on Kerbin -
Space Computer. Brought to you by kOS and hopefully many nerds.
Ozin replied to Payload's topic in Science & Spaceflight
The issue isn't getting the horizontal speed. It's getting the direction of it. We need a surface prograde vector or angle. I'm also missing being able to get my ship's current angle, got my fingers crossed for that one being implemented soon. Also, I've been playing around with your PI controller script, thanks for sharing that. Slapped this together, it seems to work well, with little-to-no overshoot. print "Hovering..". set radius to 600000. set g to 9.81. set TargetH to 1000. lock steering to up + R(0,0,180). set I to 0. set deactivateFlag to 0. on AG9 set deactivateFlag to 1. until deactivateFlag=1 { set WTR to (mass*g*((radius/(radius+altitude))^2)/maxthrust). set E to (TargetH - ALT:RADAR) - (verticalspeed*2). set P to (0.1*(E))*WTR. set I to (0.03*(E + I))*WTR. lock throttle to P+I. if verticalspeed < (((TargetH - alt:radar)/10)-20) { lock throttle to 1. }. if verticalspeed > (((TargetH - alt:radar)/10)+25) { lock throttle to 0. }. print "e: " + E. }. print "Exiting..". The two if statements slow the vessel down gradually as it aproaches the target altitude. It should probably take gravity and TWR into account, didn't get to that yet. The beauty of the pi controller is that it lets me change my horizontal speed while keeping hover to the same altitude. Very nice -
Sounds good! The != operator would be handy as well. Here is my hover and landing script in case anyone wants to have a look. It works pretty well, at least for medium to light rockets. hover.txt - AG2: Ascend, AG3: Hover, AG4: Descend, AG5 Switch to land script. clearscreen. print "Activated autohover..". sas off. lock steering to R(up:pitch,up:yaw,prograde:roll - 90). set t to 0. set first to 1. set targetAlt to 0. set x to 0. until x = 1 { on ag2 set t to 3. on ag3 set t to 0. on ag4 set t to -3. set thr to (maxthrust/10). set thr to thr + 0.5. set m to mass. set TWR to (thr/m). set WTR to (m/thr). set mod to 0. if first = 1 { set keepAlt to 1. }. if first = 0 { set keepAlt to 0. }. if t > 0 { set first to 1. set keepAlt to 0. set targetAlt to 0. }. if t < 0 { set first to 1. set keepAlt to 0. set targetAlt to 0. }. if verticalspeed < t { set mod to 0.02. }. if verticalspeed < (t - 1) { set mod to 0.04. set keepAlt to 0. }. if verticalspeed < (t - 4) { set mod to 0.1. }. if verticalspeed < (t - 8) { set mod to 0.3. }. if verticalspeed > t { set mod to -0.02. }. if verticalspeed > (t + 1) { set mod to -0.04. set keepAlt to 0. }. if verticalspeed > (t + 4) { set mod to -0.1. }. if verticalspeed > (t + 8) { set mod to -0.3. }. if keepAlt = 1 { set first to 0. set targetAlt to altitude. }. if altitude > targetAlt { set mod2 to -0.02. }. if altitude < targetAlt { set mod2 to 0.02. }. if targetAlt > 0 { set mod to mod2. }. lock throttle to (WTR + mod). print "---". print "first: " + first. print "keepAlt: " + keepAlt. print "targetAlt: " + targetAlt. print "altitude: " + altitude. print "target v: " + t. print "mod: " + mod. print "vSpeed: " + verticalspeed. on ag5 set x to 1. }. run land. It's a bit messy without nested if statements, but it does the job land.txt - AG2: abort. AG4: shut down engines (you got 10 seconds to turn down throttle manually or shut down engines before script ends) print "Landing..". set x to 0. set offset to 5. until x > 0 { set t to -1. if alt:radar > (20 + offset) { set t to -4. }. if alt:radar > (100 + offset) { set t to -8. }. if alt:radar > (200 + offset) { set t to -16. }. if alt:radar > (400 + offset) { set t to -40. }. set thr to (maxthrust/10). set thr to thr + 0.5. set m to mass. set TWR to (thr/m). set WTR to (m/thr). set mod to 0. if verticalspeed < t { set mod to 0.03. }. if verticalspeed < (t - 2) { set mod to 0.07. }. if verticalspeed < (t - 8) { set mod to 0.2. }. if verticalspeed < (t - 16) { set mod to 0.4. }. if verticalspeed > t { set mod to -0.02. }. if verticalspeed > (t + 2) { set mod to -0.04. }. if verticalspeed > (t + 8) { set mod to -0.1. }. if verticalspeed > (t + 16) { set mod to -0.3. }. if verticalspeed > (t + 40) { set mod to -0.5. }. lock throttle to (WTR + mod). print "---". print "target v: " + t. print "mod: " + mod. print "vSpeed: " + verticalspeed. print "altradar: " + alt:radar. on ag4 set x to 1. on ag2 set x to 2. }. if x = 1 { lock throttle to 0. print "Shut down engines within 10 seconds!". wait 10. unlock throttle. }. if x = 2 { print "Abort landing! ". run hover. }.
-
It would be great if if-blocks could be nested in each other. Using an if in an if block currently doesn't work, not sure if that's a bug or if it's just not supported (yet?).
-
Thanks for fixing, keep up all the good work
-
Current mass.
-
I've found a bug where the game will freeze upon locking steering to an R() angle. I'll include a screenshot: As you can see, the individual values were tested and working prior to using them within the angle. edit: Also crashed after entering these two lines in the console: set TWR to (maxthrust/mass). print "TWR: " + TWR.