Jump to content

Need help for accurate Landing Burn Altitude (kOS)


M4GiC

Recommended Posts

I have been trying to figure out the exact landing burn altitude for my hoverslam script and I can't work it out accurately. I've looked at others' script but does not seem to work well with my script.

lock burnAlt to (ship:velocity:surface:mag^2)/(2*(ship:sensors:acc:mag)). 

This is what I use to determine the landing burn altitude.  And my condition is:

if trueRader <= burnAlt {
	set autoThrottle to hoverslam.
} else {
    set autoThrottle to 0.
}

From what i understand from this condition, the throttle should be never 0 whenever it is below and equal to burnAlt unless otherwise. But that's the problem, the burnAlt decreases as the rocket throttling up.  Do I need to use constant to find my landing burn altitude or something else that is more efficient? 

P.S: This does not account for aerodynamic drag nor that it need to be accounted for as I'm playing stock and not RSS/FAR.

 

Edited by M4GiC
Spelling
Link to comment
Share on other sites

Unless your whole script is meant to be run in a loop, you might want to use the

WAIT UNTIL ALT:RADAR < burnAlt

instruction to just delay further script execution until you're certain to be below the threshold altitude.

Link to comment
Share on other sites

I don't remember exactly what ship:sensors:acc:mag returns, but in the equation you're using you should subtract gravity from the craft's max acceleration. Also, alt:radar is measured from the center of mass, which is not zero when you're landed, so you might want to look into the bounds structure in the documentation. 

Link to comment
Share on other sites

I recently published a video on the Kerbalism channel with a deep dive walkthrough of a KOS script I wrote to automate a Mun landing. Hoverslam code is included, and it works like a dream on every body I visited in testing. The key for me was not using a constant for gravity, but instead computing the body's gravity based on altitude and standard gravitational parameter (µ).

https://www.youtube.com/watch?v=t4dIED5JLos

A link to the script is included in the video description. Hope this helps!

Edited by aubranium
Link to comment
Share on other sites

On 3/10/2020 at 4:08 PM, soulsource said:

Unless your whole script is meant to be run in a loop, you might want to use the


WAIT UNTIL ALT:RADAR < burnAlt

instruction to just delay further script execution until you're certain to be below the threshold altitude.

Yes, the script is meant to run in a loop which is the problem for me. 

On 3/10/2020 at 5:55 PM, Black-Two- said:

I don't remember exactly what ship:sensors:acc:mag returns, but in the equation you're using you should subtract gravity from the craft's max acceleration. Also, alt:radar is measured from the center of mass, which is not zero when you're landed, so you might want to look into the bounds structure in the documentation. 

I'm sure that it returns the acceleration of the ship. Okay i will try that. Yes i took that into account which create its own problem, now I'm using ship:altitude-(geoposition:terrainheight+Offset). Thank you.

Edited by M4GiC
Spelling
Link to comment
Share on other sites

On 3/11/2020 at 11:33 PM, aubranium said:

I recently published a video on the Kerbalism channel with a deep dive walkthrough of a KOS script I wrote to automate a Mun landing. Hoverslam code is included, and it works like a dream on every body I visited in testing. The key for me was not using a constant for gravity, but instead computing the body's gravity based on altitude and standard gravitational parameter (µ).

https://www.youtube.com/watch?v=t4dIED5JLos

A link to the script is included in the video description. Hope this helps!

Great video! And great script as well. Although, I've seen that hoverslam code before but I was hesitant of using it, don't know why.  I am using this one instead which is rather complicated. 

declare function hoverslamthrot {
	local targetaccres is (ship:velocity:surface * ship:up:vector) / (2*trueRadarLand) * ship:velocity:surface.
	local neededengineacc is targetaccres - gravitacc() - coriolisacc() - centrifugalacc() - dragforce(cdTimesA, 1*trueRadarLand, 1*ship:velocity:surface)/ship:mass.
	return (neededengineacc:mag * ship:mass)/ship:availablethrust.
}

But I'm going to try what you are using and see if it works better. 

BTW, what mic are using in that video? It sounds great. 

Link to comment
Share on other sites

On 3/13/2020 at 2:12 AM, M4GiC said:

BTW, what mic are using in that video? It sounds great. 

Thanks! I use a Shure SM7B mic with a CloudLifter pre-amp and a Zoom H4N recorder. I've been podcasting for about 7yrs about technology, design, and startup life (https://distilledradio.com). I'm thrilled to hear you enjoyed the video. Please share with your friends. 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...