glidePIDController

GlidePIDController is a PID oriented controller, it contains methods that will guide your rocket through glide towards target maneuver. During the descent glidePIDController will adjust the course only through means of control surfaces and RCS controls.

Table of contents:

Contructing

parameters type default Description
ldata landingDataModel - landingDataModel constructed with desired landing position
Kp float - proportional response
Ki* float 0 integral response
Kd* float 0 derivative response
minOut* float -10 minimal PID output(basically aoa difference)
maxOut* float 10 maximal PID output(aoa difference)

* optional parameters

Public methods

public methods return type Description
getSteering() Direction returns steering direction
getThrottle() Float returns 0
completed() Boolean is throttle larger than 0?
passControl(bool) None passes control

getSteering()

No parameters

Returns steering direction.


getThrottle()

No parameters

Because gliding is unpowered flight, always returns 0.


completed()

No parameters

Returns true if throttle is larger than 0.


passControl(bool)

Parameters:

  • isUnlocking::Boolean -> should throttle and steering be unlocked?

Takes control over both steering and throttle until completed() returns true.


Code examples


// minimal tuning because gliding doesn't have to be
// exceptionally precise in most cases
local ldata is landingDataModel(target:geoposition).
local glide is glidePIDController(ldata, 2000).

lock steering to glide["getSteering"]().
local ldata is landingDataModel(target:geoposition).
// max aoa of 5 and derivative response
local glide is glidePIDController(ldata, 2000, 0, 500, -5, 5).

lock steering to glide["getSteering"]().