Functions

This page documents all public functions exported by KiteControllers.jl.

SystemStateControl

These methods drive the top-level state machine.

KiteControllers.on_autopilot — Function
on_autopilot(ssc::SystemStateControl)

Command the system to start automated power production (ssPowerProduction state). Precondition: the kite must be parked at a sufficiently high elevation angle.

source
KiteControllers.on_parking — Function
on_parking(ssc::SystemStateControl, tether_length=nothing)

Command the system to transition to the ssParking state. Optionally pass the current tether_length [m] to allow a controlled approach.

source
KiteControllers.on_winchcontrol — Function
on_winchcontrol(ssc::SystemStateControl)

Switch to ssWinchControl state: winch is controlled automatically, steering is performed manually.

source
KiteControllers.on_new_systate — Method
on_new_systate(ssc::SystemStateControl, sys_state)

Feed the current SysState (from the kite model or measurement) into the SystemStateControl. Must be called once per simulation time step before calling calc_v_set and calc_steering.

source
WinchControllers.calc_v_set — Method
calc_v_set(ssc::SystemStateControl)

Compute and return the winch speed set-point [m/s] for the current time step. Returns nothing if no system state has been provided yet via on_new_systate.

source

Configuration

KiteControllers.read_project — Method
read_project() -> String

Read the active project filename from data/gui.yaml. If the file does not exist it is created from gui.yaml.default.

source
Missing docstring.

Missing docstring for get_default_turbulence(). Check Documenter's build log for details.

KiteControllers.get_use_turbulence — Function
get_use_turbulence(project::String) -> Union{Float64, Nothing}

Read use_turbulence from <data_path>/<project>. If no overwrite block is present, return get_default_turbulence().

source
Missing docstring.

Missing docstring for set_default_turbulence. Check Documenter's build log for details.

FlightPathPlanner

The flight path planner manages flight-phase transitions and forwards kite state to the flight path controller.

KiteControllers.start — Method
start(fpp::FlightPathPlanner, v_wind)

Start automated power production.

Transitions the flight path planner from the parking or manual-operation state into the power-production phase (state POWER) and updates the ground-level wind speed used by the flight path calculator.

Precondition: the kite must be parked at a high elevation angle (system state ssManualOperation or ssParking). If the system is in any other state this call has no effect on the flight phase, though the wind speed is still updated.

Arguments

  • fpp: the FlightPathPlanner instance.
  • v_wind: current ground-level wind speed in m/s.
source
KiteControllers.is_active — Method
is_active(fpp::FlightPathPlanner)

Return true if the flight path planner has left its initial state, i.e. start has been called and the planner is actively managing the flight phase.

source
WinchControllers.get_state — Method
get_state(fpp::FlightPathPlanner)

Return the current flight phase of the planner as an Int, suitable for logging. The integer corresponds to the underlying @enum value (e.g. INITIAL, POWER, …).

source
KiteControllers.on_new_systate — Method
on_new_systate(fpp::FlightPathPlanner, phi, beta, heading, course, v_a, u_d)

Forward the current estimated kite system state to the FlightPathController by calling on_est_sysstate. Sign conventions are applied before forwarding: azimuth and heading angles are negated to match the controller's coordinate frame.

Arguments

  • fpp: the FlightPathPlanner instance.
  • phi: azimuth angle of the kite in radians (positive to the left).
  • beta: elevation angle of the kite in radians.
  • heading: kite heading angle ψ in radians, in the range 0 .. 2π.
  • course: kite course angle χ in radians, in the range 0 .. 2π.
  • v_a: apparent wind speed in m/s.
  • u_d: relative depower setting of the kite, in the range 0.0 .. 1.0.
source
KiteControllers.on_new_data — Function
on_new_data(fpp::FlightPathPlanner, depower, length, heading, height, _=0.0)

Evaluate the current kite state and trigger a flight-phase transition via _switch when the transition conditions defined in Tables 5.3–5.6 of the PhD thesis are satisfied.

Arguments

  • fpp: the FlightPathPlanner instance.
  • depower: relative depower setting of the kite, in the range 0.0 .. 1.0.
  • length: tether length in metres.
  • heading: kite heading angle ψ in radians, in the range 0 .. 2π.
  • height: kite height above ground in metres.

State read from fpp.fpca

  • _phi: kite azimuth angle in degrees.
  • _beta: kite elevation angle in degrees.
  • _omega: kite angular speed in degrees per second.
source

FlightPathController

The flight path controller translates planned trajectory information into a steering signal u_s.

KiteControllers.on_control_command — Function
on_control_command(fpc, attractor=nothing, psi_dot_set=nothing, radius=nothing, intermediate = true)

Input: Either the attractor point (MVector of azimuth and elevation in radian), or psi_dot, the set value for the turn rate in degrees per second.

source
KiteControllers.on_est_sysstate — Function
on_est_sysstate(fpc, phi, beta, psi, chi, omega, v_a; u_d=nothing, u_d_prime=nothing)

Parameters:

  • phi: azimuth angle of the kite position in radian
  • beta: elevation angle of the kite position in radian
  • psi: heading of the kite in radian
  • chi: course of the kite in radian
  • omega: angular velocity of the kite on the unit sphere in degrees/s ???
  • u_d: depower settings [0..1]
  • u_d_prime normalized depower settings [0..1]

Either u_d or u_d_prime must be provided.

source
KiteControllers.calc_steering — Function
function calc_steering(fpc, parking)

Calculate the steering output u_s and the turn rate error err, but also the signals Kpsi_out, Ku_out and int_in.

Implements the simulink block diagram, shown in: 01_doc/flight_path_controller_I.png

If the parameter parking is true, only the heading is controlled, not the course.

source

WinchController (re-exported)

The following functions are re-exported from WinchControllers.jl. See that package's documentation for details.

WinchControllers.calc_v_set — Function
calc_v_set(ssc::SystemStateControl)

Compute and return the winch speed set-point [m/s] for the current time step. Returns nothing if no system state has been provided yet via on_new_systate.

source

Observer

KiteControllers.observe! — Function
observe!(ob::KiteObserver, log::SysLog, elev_nom=26)

Process a SysLog and populate the KiteObserver with per-half-cycle elevation measurements and correction values for the flight path planner.

source