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.
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.
KiteControllers.on_reelin — Function
on_reelin(ssc::SystemStateControl)Command the system to reel in the tether (ssReelIn state).
KiteControllers.on_stop — Function
on_stop(ssc::SystemStateControl)Stop all automation and switch to ssManualOperation.
KiteControllers.on_winchcontrol — Function
on_winchcontrol(ssc::SystemStateControl)Switch to ssWinchControl state: winch is controlled automatically, steering is performed manually.
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.
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.
KiteControllers.get_depower — Method
get_depower(_ssc::SystemStateControl)Return the current depower set-point (0..1) computed by the flight path planner.
Configuration
KiteControllers.read_project — Method
read_project() -> StringRead the active project filename from data/gui.yaml. If the file does not exist it is created from gui.yaml.default.
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().
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: theFlightPathPlannerinstance.v_wind: current ground-level wind speed in m/s.
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.
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, …).
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: theFlightPathPlannerinstance.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 range0 .. 2π.course: kite course angleχin radians, in the range0 .. 2π.v_a: apparent wind speed in m/s.u_d: relative depower setting of the kite, in the range0.0 .. 1.0.
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: theFlightPathPlannerinstance.depower: relative depower setting of the kite, in the range0.0 .. 1.0.length: tether length in metres.heading: kite heading angleψin radians, in the range0 .. 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.
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.
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_primenormalized depower settings [0..1]
Either u_d or u_d_prime must be provided.
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.
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.
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.