Functions and Simulink models#
Functions#
Pre-simulation#
- determine_startPos_retractTarget(pathparam, tetherParams)#
- Setting the start position and retraction target based on given flight pattern.
For each flight pattern a different target point is used during retractions. This is determined by this function. Additionally, the start position of the kite for the simulation is also determined.
- Parameters:
pathparam (
struct
) – Structure containing pattern specific parameters.tetherParams (
struct
) – Structure containing tether specific parameters.
- Returns:
Kite start position in wind reference frame. targetP_retract (3x1 double): Retraction phase target position in wind reference frame.
- Return type:
targetP_start (3x1 double)
- Author:
Dylan Eijkelhof (d.eijkelhof@tudelft.nl)
- Date:
2024-10-31
- runParamSim(fileName, MegAWESkite, listvars, optsIN, paramUbounds, Int_listvars)#
Converting simulation inputs to the correct structure for simulink.
Input files (yaml) is converted to the right structure for the simulink model. All inputs are determined in this function. if more than two arguments are provided, 3rd - 5th all have to be provided at minimum. 6th argument is always optional or can be an empty cell array.
- Parameters:
fileName (
char
) – Simulation input yaml filename.MegAWESkite (
struct
) – Structure containing kite specific parameters, imported from MegAWESkite.yaml file.listvars (
Optional, mx1 cell
) – Variable names that can vary during optimisation.optsIN (
Optional, mx1 double
) – Normalised values corresponding to listvars to overwrite the default.paramUbounds (
Optional, mx1 double
) – Optimisation upper boundaries corresponding to listvars to scale the optsIN values.Int_listvars (
Optional, ?x1 cell
) – Variable names which corresponding values have to be converted to discrete values (integers).
- Returns:
Structure containing simulation initialisation parameters. ENVMT (struct): Structure containing environmental parameters. controllerGains_traction (struct): Structure containing required controller gains for the traction phase. controllerGains_retraction (struct): Structure containing required controller gains for the retraction phase. tetherParams (struct): Structure containing tether specific parameters. pathparam (struct): Structure containing pattern specific parameters. actuatorLimit (struct): Structure containing actuator limits. winchParameter (struct): Structure containing winch sizing and required controller parameters.
- Return type:
simInit (struct)
- Author:
Dylan Eijkelhof (d.eijkelhof@tudelft.nl)
- Date:
2024-10-31
Import Data
- transformFromOtoW(windDirection_rad, vec_O)#
This function transforms a vector from inertial reference frame to wind reference frame.
- Parameters:
windDirection_rad (
double
) – Angle between the wind reference frame and the inertial reference frame around the z-axis.vec_O (
3x1 double
) – Vector in inertial reference frame.
- Returns:
Vector in wind reference frame.
- Return type:
vec_W (3x1 double)
Note
Axis system is not only rotated around the z-axis but also also flipped upside down. \(Z_W = -Z_O\).
- Author:
Sebastian Rapp
- transformFromWtoO(windDirection_rad, vec_W)#
This function transforms a vector from wind reference frame to inertial reference frame.
- Parameters:
windDirection_rad (
double
) – Angle between the wind reference frame and the inertial reference frame around the z-axis.vec_W (
3x1 double
) – Vector in wind reference frame.
- Returns:
Vector in inertial reference frame.
- Return type:
vec_O (3x1 double)
Note
Axis system is not only rotated around the z-axis but also also flipped upside down. \(Z_O = -Z_W\).
- Author:
Sebastian Rapp
- extractSignalOfLastCycle2(signal, sample_count_last_cycle, simInit)#
Extract 1D data from the last converged power cycle.
- Parameters:
signal (
double timeseries
) – Full 1D timeseries simulation output.sample_count_last_cycle (
double timeseries
) – Simulation timeseries ‘cycle_signal_counter’.simInit (
struct
) – Structure containing simulation initialisation parameters.
- Returns:
Extracted power cycle 1D timeseries.
- Return type:
signalData (double)
- Date:
2019-12-01
- Authors:
Sebastian Rapp, Dylan Eijkelhof (d.eijkelhof@tudelft.nl)
- extractSignalOfLastCycle3D(signal, sample_count_last_cycle, simInit)#
Extract 3D data from the last converged power cycle.
- Parameters:
signal (
double timeseries
) – Full 3D timeseries simulation output.sample_count_last_cycle (
double timeseries
) – Simulation timeseries ‘cycle_signal_counter’.simInit (
struct
) – Structure containing simulation initialization parameters.
- Returns:
Extracted power cycle 3D timeseries.
- Return type:
signalData (double)
- Date:
2020-05-01
- Authors:
Sebastian Rapp, Dylan Eijkelhof (d.eijkelhof@tudelft.nl)
Main simulink model#
The following image shows the root level of the simulink model. This shows how the different modules work together. This level is similar for both 3DoF and 6DoF simulations.
Simulink parts#
Environment#
The following image shows the environment subsystem of the simulink model. This subsystem is similar for both 3DoF and 6DoF simulations. It is used to determine the wind speed at each tether particle and at the kite.
Flight controller#
The following image shows the root level of the flight controller
Ground station#
The following image shows the ground station subsystem of the simulink model. This subsystem is similar for both 3DoF and 6DoF simulations.
Tether dynamics#
The functions are described inside simulink. The following image shows the what the inputs and outputs are of the tether module. This subsystem is similar for both 3DoF and 6DoF simulations.