Help with landing script

I was interested in your problem myself. Here is one quick solution using a PID. It will not catch all possible situations with all craft, but it worked for

me for this simple short hop. Looking again at your video, I suspect you may not have reaction wheels nor RCS, so the craft cannot orient itself to hold

retrograde. Using a piloted pod gives you reaction wheels, and the engine re-charges the battery to run them just fine. I did try your script using LOCK

STEERING TO SRFRETROGRADE. This made my craft do the crazy breakdance styled backspin. Brilliant. You'll notice I've fixed this in the script below by

leaving the steering locked to UP. No good for a de-orbit approach where you're coming in sideways, but fine for this straight up hop. Set the throttle

manually to 0 before running the script or it takes off again once the script ends... I created a ship using

  • KR-2042b Scriptable Control System
  • mk1 command pod
  • Rockomax X200-8 fuel tank
  • LV-T45 Swivel engine
  • 4 x LT-2 Landing Struts

    clearscreen. set throt to 1. lock THROTTLE to throt. lock STEERING to UP. Set padheight to ALTITUDE.

    stage. wait 2. set throt TO 0.

    wait until SHIP:VERTICALSPEED < -4. // Ship is falling.

    set kp to 0.5. set ki to 0. set kd to 0. set PID to PIDLOOP(kp, ki, kd, 0, 1). set PID:SETPOINT TO -4.

    until ALTITUDE <= padheight { set throt to PID:UPDATE(TIME:SECONDS, SHIP:VERTICALSPEED). print "Radar = " + round(alt:radar,2) at (5,20). print "Throttle = " + round(throt,2) at (5,21). print "Vertical Speed = " + round(SHIP:VERTICALSPEED,2) at (5,22). wait 0.001. }.

    set throt to 0. print "Landed".

/r/Kos Thread