Examples, if installed as Package

The example scripts can be copied to a local examples/ folder with:

using KiteControllers
KiteControllers.copy_examples()

Or install everything (examples + required packages) in one step:

KiteControllers.install_examples()

Examples, if installed using Git

Launch Julia with:

jl

Then you get the menu of the examples by typing:

menu()

autopilot.jl — Full Autopilot Simulation

The primary example demonstrating the complete control stack.

Features:

  • Loads a kite model (KPS4) and kite control unit (KCU)
  • Creates all settings (WCSettings, FPCSettings, FPPSettings)
  • Builds a SystemStateControl and connects it to the kite model
  • Runs a real-time simulation loop with a 3-D viewer

Screenshot:

Minimal usage pattern

You can select one of the four, pre-defined projects, run the simulation, and on the left you have menu options to print the statistics or show one of the many 2D plots, visualizing the results.

autopilot_matlab.jl — Autopilot with the Winch Model in Matlab

Runs autopilot.jl with the winch model implemented in Matlab instead of the winch model of the selected project. Needs a Matlab installation, see Winch Model in Matlab.

parking_4p.jl — Parking Controller

Demonstrates how to bring a four-line kite to a stable parking position at high elevation using on_parking.

using KiteControllers, KiteModels
# create ssc as above, then:
on_parking(ssc, tether_length=200.0)

parking_wind_dir.jl — Parking with Changing Wind Direction

Demonstrates parking control while the upwind direction changes over time. The script applies a gradual wind-direction shift during the simulation, uses the parking controller to maintain stable flight, and plots azimuth, heading, upwind direction, and steering for analysis.

minipilot.jl — Minimal Autopilot

A stripped-down autopilot without 2D plots for understanding how to build a GUI based simulator. Exposes the core control loop in ~50 lines.

batch_pilot.jl — Batch Simulation

Runs multiple simulations back-to-back over a range of wind speeds and records key statistics (mean power, reel-out speed, etc.) to an Apache Arrow file in the output/ folder.

Run from the command line:

bin/batch_pilot hydra20_426

Statistics are written to output/batch-<project>_stats.yaml and the full time-series log to output/batch-<project>.arrow.


batch_plot — Post-processing Viewer

Interactive command-line tool for visualizing the Arrow log files produced by batch_pilot. Backed by examples/batch_plot.jl and the launcher script bin/batch_plot.

Basic usage:

# Open the interactive plot-selection menu for a project
bin/batch_plot hydra20_426

# Run a specific plot directly (window stays open until closed)
bin/batch_plot hydra20_426 plot_main
bin/batch_plot hydra20_426 plot_elev_az

# List all projects that have a log file in output/
bin/batch_plot --list

# List all available plot commands
bin/batch_plot --list-commands

Available plot commands:

CommandDescription
statisticsPrint summary statistics to the terminal
plot_mainHeight, elevation, azimuth, tether length, force, reel-out speed, cycle
plot_powerForce, reel-out speed, mechanical power, energy, acceleration
plot_controlElevation, azimuth, heading, force, depower, steering, FPP state
plot_control_IIAzimuth, heading, steering, course, psi_dot, NDI gain
plot_winch_controlElevation, azimuth, force, set-force, reel-out speed, winch state
plot_aerodynamicsLift-to-drag ratio, angle of attack, steering, yaw rate, side-slip
plot_elev_azElevation vs. azimuth scatter
plot_elev_az2Elevation vs. azimuth from cycle 2 onward
plot_elev_az3Elevation vs. azimuth from cycle 3 onward
plot_side_viewSide view (height vs. x position)
plot_side_view2Side view from cycle 2 onward
plot_side_view3Side view from cycle 3 onward
plot_front_view3Front view from cycle 3 onward

tune_4p.jl — Controller Tuning

Interactive script for tuning the flight path controller gains (p, i, d, gain) for a four-line kite. Changes gain values and immediately re-runs the simulation to visualize the effect.

joystick.jl — Manual Joystick Control

Allows manual steering via a gamepad or joystick while the winch is controlled automatically or half-automatically by the WinchController. Useful for learning how to steer a kite manually. Half-automatically means you provide a set point for the reel-out speed manually, but the WinchController ensures that the maximal and minimal force are respected.

Learning Resources

FilePurpose
autopilot.jlFull autopilot — start running this as first step
minipilot.jlMinimal autopilot without 2D plotting, good for understanding the code
parking_4p.jlParking of the 4 point kite with disturbance
parking_wind_dir.jlParking simulation with gradually changing upwind direction
batch_pilot.jlBatch simulations of projects
batch_plotPost-processing and interactive plotting of batch logs
tune_4p.jlGain tuning of the parking controller
joystick.jlManual steering with automated or half-automated winch control
plots.jlPost-processing and plotting of Arrow log files, not to be executed on its own
stats.jlStatistical analysis of batch results, not to be executed on its own

Configuration Files

All settings are stored as YAML files in the data/ folder.

FileSettings struct
settings.yamlGeneral kite / simulation settings (KiteUtils.Settings)
system.yamlSystem-level parameters
fpc_settings.yamlFPCSettings — flight path controller
fpp_settings.yamlFPPSettings — flight path planner
wc_settings.yamlWCSettings — winch controller

Copy the default configuration files with:

KiteControllers.copy_control_settings()