hoverSlamModel

HoverSlamModel makes calculations and holds data related to performing the final burn. It calculates throttle levels and when the engines should fire with equations of motion.

Table of contents:

Contructing

parameters type default Description
bias float - how high is your rocket, advised to overshoot this value a little
maxTwr* float -1 maximum TWR during final burn, if it’s less than 0, hoverSlamModel will automatically calculate maximal possible TWR

* optional parameters

Public methods

public methods return type Description
getThrottle() float returns throttle percentage

getThrottle()

No parameters

Returns throttle percentage. The method uses numerical solution with equations of motion to predict when the burn should start.


Code examples


Give code examples

// let's assume we are on our descent
// our rocket is 15 meters high
local hoverslam is hoverSlamModel(15). // new hoverSlamModel object


lock steering to ship:srf:retrograde.
lock throttle to hoverslam["getThrottle"](). // locking throttle
// at some point hoverslam will apply the throttle in such a way
// that ideally our velocity should become 0 m/s at 0 meters above
// terrain level.

wait until ship:status = "landed" or ship:status = "splashed".
lock throttle to 0.