Types
This page documents all public types exported by KiteControllers.jl.
Settings
Settings structs are constructed once and passed to the corresponding controller. They can be populated automatically from YAML configuration files in the data/ folder by passing true to the constructor (e.g. FPCSettings(true)).
KiteControllers.FPCSettings — Type
Settings of the FlightPathController.
Loaded from the YAML file returned by fpc_settings() (typically data/fpc_settings.yaml). Construct with FPCSettings(true; dt) to auto-load from disk, or FPCSettings(; dt) for defaults.
Fields
dt::Float64: controller sample period [s].log_level::Int64: logging verbosity (0 = silent, 2 = default).prn::Bool: enable general debug printing.prn_ndi_gain::Bool: print NDI gain each step.prn_est_psi_dot::Bool: print estimated turn rate each step.prn_va::Bool: print apparent wind speed each step.use_radius::Bool: use turn-radius control mode instead of heading-rate mode.use_chi: use course angle χ as the controlled variable instead of heading ψ.reset_int1::Bool: reset the main integrator to the last estimated turn rate on state entry.reset_int2::Bool: reset the D-term integrator at the second time step after a state transition.reset_int1_to_zero::Bool: reset the main integrator to zero (overridesreset_int1).init_opt_to_zero::Bool: initialize the root-finder with zero instead of the previous solution.p: proportional gain of the PID controller.i: integral gain of the PID controller.d: derivative gain of the PID controller.gain: common scaling factor applied to all of P, I and D.c1: NDI model coefficient c₁ (default ≈ 0.0613).c2: NDI model coefficient c₂ (default ≈ 1.226).k_c1: correction factor for the NDI c₁ term; increase to enlarge the turn radius.k_c2: c₂ scaling factor used during the reel-out phase.k_c2_high: c₂ scaling factor for reel-out at high elevation angles.k_c2_int: c₂ scaling factor for the intermediate phases (LOW_RIGHT,LOW_TURN,LOW_LEFT).k_ds: influence of the depower angle on the steering sensitivity.
KiteControllers.FPPSettings — Type
Settings of the FlightPathPlanner.
Loaded from the YAML file returned by fpp_settings() (typically data/fpp_settings.yaml). Construct with FPPSettings(true) to auto-load from disk, or FPPSettings() for defaults.
Fields
log_level::Int64: logging verbosity (0 = silent, 2 = default).min_depower::Float64: minimum depower during reel-out [%].max_depower::Float64: maximum depower during reel-in [%].parking_depower::Float64: depower level used while parking [%].min_length::Float64: lower tether-length limit for the reel-in/reel-out cycle [m].max_length::Float64: upper tether-length limit for the reel-in/reel-out cycle [m].max_height::Float64: maximum allowed kite height [m].beta_set::Float64: target elevation angle for the figure-of-eight centre point [°].w_fig::Float64: half-width of the figure-of-eight pattern [°].psi_dot_max::Float64: maximum turn rate of the kite [rad/s].r_min::Float64: minimal turn radius [°].r_max::Float64: maximal turn radius [°].heading_offset_low::Float64: heading lead angle before finishing right/left turns [°].heading_offset_int::Float64: heading lead angle for the turn around the intermediate point [°].heading_offset_high::Float64: heading lead angle for elevation angles > 47.5° [°].heading_offset_up::Float64: heading lead angle before finishing the up-turn [°].heading_upper_turn::Float64: heading angle that triggers the upper turn [°].k_factor::Float64: scaling factor for the attractor distance.timeout::Float64: maximum number of time steps allowed in a single planner state before a forced transition.corr_vec::Vector{Float64}: elevation-angle correction look-up table (12 entries).
The
WCSettingstype is documented in WinchControllers.jl.
System State
KiteControllers.SystemState — Type
SystemStateTop-level system state enum used by SystemStateControl.
Values: ssManualOperation, ssParking, ssPowerProduction, ssReelIn, ssWinchControl, ssPower, ssKiteReelOut, ssIntermediate, ssWaitUntil, ssDepower, ssLaunching, ssLanding, ssEmergencyLanding, ssTouchdown.
The SystemState enum has the following values:
| Value | Integer | Description |
|---|---|---|
ssManualOperation | 0 | Manual control — no automation |
ssParking | 1 | Kite is parked at high elevation |
ssPower | 2 | Power phase in progress |
ssKiteReelOut | 3 | Kite is being reeled out |
ssWaitUntil | 4 | Waiting until kite reaches high elevation |
ssDepower | 5 | Kite is being depowered |
ssIntermediate | 6 | Transition phase before reel-out |
ssLaunching | 7 | Kite launch sequence |
ssEmergencyLanding | 8 | Emergency landing |
ssLanding | 9 | Kite landing sequence |
ssReelIn | 10 | Tether is being reeled in |
ssTouchdown | 11 | Touchdown state |
ssPowerProduction | 12 | Automated power production (figure-of-eight) |
ssWinchControl | 13 | Automated winch control with manual steering |
Flight Path Planner States
The FPPS (@enum) describes the sub-states of the flight path planner:
| Value | Integer | Meaning |
|---|---|---|
INITIAL | 0 | Initial state |
UPPER_TURN | 1 | Upper turn after ascending |
LOW_RIGHT | 2 | Low intermediate turn (right) |
LOW_TURN | 3 | Turn around intermediate point |
LOW_LEFT | 4 | Low intermediate turn (left) |
TURN_LEFT | 5 | Turn at the left extreme of figure-of-eight |
FLY_RIGHT | 6 | Straight-flight section to the right |
TURN_RIGHT | 7 | Turn at the right extreme of figure-of-eight |
FLY_LEFT | 8 | Straight-flight section to the left |
UP_TURN | 9 | Ascending turn before depower |
UP_TURN_LEFT | 10 | Left part of ascending turn |
UP_FLY_UP | 11 | Ascending straight section |
DEPOWER | 12 | Depower phase |
POWER | 13 | Power phase |
PARKING | 14 | Parking phase |
Planner and Controllers
KiteControllers.FlightPathPlanner — Type
FlightPathPlannerTop-level flight path planner as specified in chapter 5 of the PhD thesis of Uwe Fechner.
Manages the sequence of flight path phases (power, turns, intermediate, depower, parking) by running a state machine whose transitions are evaluated on every call to on_new_data. It drives the FlightPathCalculator, and thereby the FlightPathController, with appropriate attractor points or turn-rate commands.
Fields
fpps::FPPSettings: flight path planner settings (geometry, limits, PID gains).fpca::FlightPathCalculator: the associated flight path calculator.corr_vec::Vector{Float64}: elevation-angle correction look-up vector (loaded fromfpps.corr_vec)._state::FPPS: current planner state (one of theFPPSenum values); starts atINITIAL.delta_depower: additional depower offset applied when generated power is too high.const_dd: depower interpolation coefficientδ_d(default0.7).u_d_ro: relative depower during reel-out (0.01 * fpps.min_depower).u_d_ri: relative depower during reel-in (0.01 * fpps.max_depower).u_d_pa: relative depower during parking (default0.25).l_low: lower tether-length limit for the reel-in/reel-out cycle [m].l_up: upper tether-length limit for the reel-in/reel-out cycle [m].z_up: maximum allowed kite height [m].count: general-purpose iteration counter.finish::Bool: flag set when the current reel-out cycle should finish after returning to centre.last_phi: azimuth angle from the previous time step [°], used for zero-crossing detection.timeout: counter incremented each call toon_new_data; reset on every state transition.
KiteControllers.FlightPathCalculator — Type
FlightPathCalculatorComputes the planned figure-of-eight flight path attractor points and the angular speed of the kite (omega) on the unit sphere. A new path is calculated:
- at the beginning of the reel-out phase (when
onNewSystemState(ssIntermediate)is called) - when the elevation set-point changes (call
publish(beta_set))
See also docs/planned_flight_path.png.
KiteControllers.FlightPathController — Type
FlightPathController as specified in chapter six of the PhD thesis of Uwe Fechner.
Main inputs are calls to the functions:
on_control_command()`on_est_sys_state()
Main output is the set value of the steering u_s, returned by the method:
calc_steering()
Once per time step the method
on_timer()
must be called.
See also: docs/flight_path_controller_I.png and docs/flight_path_controller_II.png and docs/flight_path_controller_III.png
Fields
fcs::FPCSettings: settings of the flight path controller.count::Int64: cycle counter used for periodic debug output.attractor::MVector{2, Float64}: current attractor point [azimuth, elevation] in radians.psi_dot_set: desired turn rate [rad/s], ornothingwhen navigating to an attractor.psi_dot_set_final: final desired turn rate [rad/s] after the low-pass filter settles.phi: azimuth angle of the kite [rad].beta: elevation angle of the kite [rad].psi: heading of the kite [rad].chi: course (track angle) of the kite [rad].chi_factor: blending weight between heading and course (0 = heading only, 1 = course only).omega: angular velocity of the kite on the unit sphere [°/s].est_psi_dot: estimated turn rate based on heading change [rad/s].est_chi_dot: estimated turn rate based on course change [rad/s].chi_set: desired flight direction (bearing) computed bynavigate()[rad].u_d0: minimum depower setting (fully powered kite).u_d_max: maximum depower setting (fully depowered kite).u_d_prime: normalized depower setting in [0, 1].u_s_max: saturation limit for the steering output.psi_dot_max: saturation limit for the commanded turn rate [rad/s].u_d: actual depower setting in [0, 1].k_c2: active c₂ scaling factor for reel-out phase (copied fromfcs.k_c2).k_c2_int: active c₂ scaling factor for intermediate phases (copied fromfcs.k_c2_int).k_c2_hight: active c₂ scaling factor for high-elevation reel-out (copied fromfcs.k_c2_high).c1: effective NDI coefficient c₁ =fcs.c1 * fcs.k_c1[rad/m].c2: effective NDI coefficient c₂ (updated each step based on apparent wind speed).intermediate::Bool:truewhile in an intermediate planner phase (LOW_*).va: apparent wind speed at the kite [m/s].va_av: low-pass filtered apparent wind speed [m/s].va_min: minimum apparent wind speed used for full NDI [m/s].ndi_gain: quotient of NDI output over input (used for anti-windup).int::Integrator: integrator for the I term of the PID controller.int2::Integrator: integrator for the D term of the PID controller.k_u: anti-windup gain for the saturated steering signal.k_psi: anti-windup gain for the saturated turn rate.err: heading/course error fed into the PID controller [rad].res::MVector{2, Float64}: residual vector of the nonlinear solver.u_s: steering output of the FPC in [-1, 1].k_psi_out,k_u_out,k_psi_in,k_u_in: internal anti-windup signals.int_in,int2_in: inputs to the I and D integrators (for logging).reset_int1::Bool: flag to reset the main integrator at the nextcalc_steeringcall.radius: commanded turn radius [m], ornothingwhen not in radius-control mode._n: filter coefficient for the discrete derivative in the D term._i: call counter forcalc_steering; used to trigger one-shot initializations.
KiteControllers.SystemStateControl — Type
SystemStateControlHighest-level state machine that coordinates the winch controller and the flight path planner. It exposes a small set of commands (on_autopilot, on_parking, on_reelin, on_stop, on_winchcontrol) that trigger state transitions, and two outputs per time step: the winch speed set-point (calc_v_set) and the steering signal (calc_steering).
Construct via:
ssc = SystemStateControl(wcs::WCSettings, fcs::FPCSettings, fpps::FPPSettings;
u_d0, u_d, v_wind)WinchController (re-exported)
The following types are re-exported from WinchControllers.jl:
WinchController— main winch controllerSpeedController— inner speed loopLowerForceController— lower tether force limitUpperForceController— upper tether force limitIntegrator— discrete integrator blockUnitDelay— unit delay blockRateLimiter— rate limiter blockMixer_2CH— two-channel mixerMixer_3CH— three-channel mixerCalcVSetIn— set-point calculator
Observer
KiteControllers.KiteObserver — Type
KiteObserverCollects flight path statistics from a simulation log to enable correction of the elevation profile over successive figure-of-eight cycles.
Construct with KiteObserver(), then call observe!(ob, log) to populate.