% Copyright (C) 2024, Naoki Sean Pross, ETH Zürich % % Retrieve / compute parameters for UAV. function [params] = uav_params() % Unit of measurements unless specified otherwise are % Mass in kg % Lenghts in m % Time in s % Frequencies in Hz % Angular velocities in rad / s params = struct(); % ------------------------------------------------------------------------ % Physical constants params.physics = struct(... 'Gravity', 9.81, ... 'AirDensity', 1.204 ... % kg / m^3 ); % ------------------------------------------------------------------------ % Mechanical measurements params.mechanical = struct(... 'Mass', 4.0, ... 'DuctRadius', 46e-3, ... 'DuctHeight', 171e-3, ... 'FlapZDistance', 98e-3, ... % flap distance along z from center of mass 'InertiaTensor', 5e-3 * eye(3), ... % TODO true values, assume diagonal 'GyroscopicInertiaZ', 0 ... % assume no gyroscopic effects for now ); % ------------------------------------------------------------------------ % Actuator limits % Cheap servos usually give a "speed" in seconds / 60 degrees without load servo_speed = 0.19; % seconds per 60 deg servo_angular_velocity = (pi / 3) / servo_speed; params.actuators = struct(... 'TurbineMaxSpeed', 620.7, ... % In Hz 'ServoAbsMaxAngleDeg', 25, ... % in Degrees 'ServoNominalAngularVelocity', servo_angular_velocity, ... 'MeasurementDelay', 8e-3 ... % delay caused by sensor fusion algorithm ); % ------------------------------------------------------------------------ % Aerodynamics modelling % Compute thrust proportionality factor from actuator limits % from thrust relation F = k * omega^2. % FIXME: this is not ideal, need better measurements omega_max = params.actuators.TurbineMaxSpeed; F_max = 38.637; % in N (measured) k_T = sqrt(F_max / omega_max); params.aerodynamics = struct(... 'ThrustOmegaProp', k_T, ... % in s^2 / (rad * N) 'FlapArea', 23e-3 * 10e-3 * 1.5, ... % FIXME factor 150% was chosen at random 'DragCoefficients', [1, 4] .* 1e-3, ... % TODO 'LiftCoefficient', 1e-3 ... % TODO ); % ------------------------------------------------------------------------ % Linearization point of non-linear dynamics. % Compute theoretical thrust required to make the UAV hover % from the relation mg = k * omega^2 g = params.physics.Gravity; m = params.mechanical.Mass; k = params.aerodynamics.ThrustOmegaProp; omega_hover = sqrt(m * g / k); params.linearization = struct(... 'Position', [0; 0; -3], ... % in inertial frame, z points down 'Velocity', [0; 0; 0], ... % in inertial frame 'Angles', [0; 0; 0], ... % in body frame 'AngularVelocities', [0; 0; 0], ... % in body frame 'Inputs', [0; 0; 0; 0; omega_hover] ... % Flaps at rest and turbine at X ); % ------------------------------------------------------------------------ % Performance requirements params.performance = struct(... 'MaxHorizontalSpeed', 1, ... ); end % vim: ts=2 sw=2 et: