Main Content

Customize VTOL UAV Configuration

This example shows you how to integrate your custom UAV control and dynamics into the VTOL UAV template.

VTOL UAVs are capable of taking off and landing vertically with the ability to transition to fixed wing flight for the majority of mission. This VTOL UAV template models a tiltrotor where the front rotors can tilt to transition from hover to fixed wing flight.

Getting Started

To open the example livescript and directory which contains the Simulink project file, first run openExample('uav/CustomizeVTOLConfigurationForYourApplicationExample') in the command window.

You must open the VTOLRefApp.prj project file to access the Simulink model, supporting files, and project shorcuts that this example uses.

% Open the Simulink project after running openExample('uav/CustomizeVTOLConfigurationForYourApplicationExample')
prj = openProject('VTOLApp/VTOLRefApp.prj');

To set up the aircraft plant model and base controller, click the Getting Started button in the project shortcuts or run the setupPlant helper function.

setupPlant;
Initialized VTOL model.
Enabled hover configuration.
Enabled hover guidance mission.

The VTOLTiltrotor Simulink® model contains these six subsystems that enable you to customize the VTOL UAV template:

  • Ground Control Station – Contains a customized mission and sends the next state for the UAV mission to enable the VTOL UAV to execute a set of maneuvers.

  • Autopilot The controller for the VTOL aircraft.

  • Digital Twin – The dynamic model of the VTOL including aerodynamics and propulsion.

  • Visualization – Visualize the UAV trajectory.

Open the VTOLTiltrotor Simulink model.

open_system("VTOLTiltrotor")
Warning: Unrecognized function or variable 'CloneDetectionUI.internal.CloneDetectionPerspective.register'.

Customize VTOL UAV Plant Model

By default, the Digital Twin subsystem models the VTOL UAV in a tilt rotor configuration. However, you can change the VTOL UAV to a different configuration such as quadplane or tailsitter by modifying the Digital Twin subsystem.

Open the Digital Twin/Model subsystem.

blockpath = Simulink.BlockPath("VTOLTiltrotor/Digital Twin/UAV Dynamics");
open(blockpath);
Warning: Unrecognized function or variable 'CloneDetectionUI.internal.CloneDetectionPerspective.register'.

The Digital Twin subsystem contains the Forces and Moments subsystem which enables you to customize the dynamics of the VTOL UAV plant model. The Forces and Moments subsystem represents the kinematics of the VTOL UAV using the 6DOF (Euler Angles) (Aerospace Blockset) block to determine body position, velocity, attitude, related values.

Open the Forces and Moments subsystem. The Forces and Moments subsystem has Actuator and CtrlSurfaces as inputs. It produces force and torque that can be passed into the 6 DOF block.

blockpath = Simulink.BlockPath(["VTOLTiltrotor/Digital Twin/UAV Dynamics", "VTOLDynamics/Force and Moments"]);
open(blockpath);
Warning: Unrecognized function or variable 'CloneDetectionUI.internal.CloneDetectionPerspective.register'.

Aerodynamics

Plug in the aerodynamic forces for your VTOL aircraft in the Aerodynamic Forces subsystem below in the lateral and longitudinal subsystems as highlighted below.

Open the Aerodynamic Forces subsystem.

blockpath = Simulink.BlockPath(["VTOLTiltrotor/Digital Twin/UAV Dynamics", "VTOLDynamics/Force and Moments/Aerodynamic Forces"]);
open(blockpath);
Warning: Unrecognized function or variable 'CloneDetectionUI.internal.CloneDetectionPerspective.register'.

Propulsion

The Propulsion subsystem models the motor, rotor, and tilt dynamics of the VTOL UAV. In this subsystem, each Rotor Assembly subsystem models the propeller dynamics for each motor-propeller pair.

By default, the Propulsion subsystem models the UAV in a tiltrotor configuration where the front 2 rotors (denoted by Rotor 1 and 2) can rotate to a vertical position during takeoff or landing, and horizontal position during fixed wing flight.

You can modify this subsystemn to adapt the VTOL UAV to a different configuration. For example, if you want to model a quadplane with 1 puller propeller, you must perform the following modifications :

  • To set the front 2 rotors to remain fixed in a vertical tilt position, replace the RotorDirection inputs for Rotor 1 and 2 to [0 0 -1], similar to rotors 3 and 4.

  • To include the puller propeller that faces forward, add another Rotor Assembly subsystem and set the RotorDirection input to [1 0 0].

Open the Propulsion subsystem.

blockpath = Simulink.BlockPath(["VTOLTiltrotor/Digital Twin/UAV Dynamics", "VTOLDynamics/Force and Moments/Propulsion"]);
open(blockpath);
Warning: Unrecognized function or variable 'CloneDetectionUI.internal.CloneDetectionPerspective.register'.

propulsionModel.png

Wind Model

To use a wind model in the VTOL UAV simulation, enable the Weather Model variant subsystem by running Wind=1.

Open the Weather Model subsystem.

blockpath = Simulink.BlockPath(["VTOLTiltrotor/Digital Twin/UAV Dynamics", "VTOLDynamics/Force and Moments/Weather Model"]);
open(blockpath);
Warning: Unrecognized function or variable 'CloneDetectionUI.internal.CloneDetectionPerspective.register'.

Weather model subsystem.

Customize VTOL UAV Control System

After modifying the VTOL UAV plant dynamics in the previous section, the control system must also be modified to accomodate the modified VTOL UAV configuration.

To customize the autopilot control system, first examine the layout of the controller in the Autopilot subsystem.

Open the Autopilot subsystem and navigate the to autopilot low level controller.

blockpath = Simulink.BlockPath(["VTOLTiltrotor/Autopilot/Controller", "VTOLAutopilotController/Low level controller"]);
open(blockpath);
Warning: Unrecognized function or variable 'CloneDetectionUI.internal.CloneDetectionPerspective.register'.

Control Scheduling

You can customize the controller for the VTOL UAV during hover mode by modifying the Multicopter Controller subsystem. Similarly, you can customize the fixed wing mode controller by modifying the Fixed Wing Controller subsystem. To customize the blending of the two controller based on the flight state of the VTOL UAV, use the Scheduler subsystem.

You can modify the tilt transition controller in the Tilt Scheduler subsystem to control behavior of the tilt of front rotors while the VTOL aircraft is in transition and back transition flight modes.

Flight State Input

The FlightState input signal represents one of four distinct flight modes of the VTOL UAV. You can modify the flightState variable by running one of setup helper functions, such as setupHoverConfiguration.

The flight modes and their corresponding flightState values are as follows:

  • Hover — 0

  • Transition — 1

  • Fixed Wing — 2

  • Back Transition — 3

Output Bus Interface

The control output signals that the Digital Twin subsystem uses are grouped together by using signal buses. By default, the VTOL UAV is configured to use the rotor control bus and fixed wing control bus.

The default rotor control bus consist of the following signals:

  • w1 — Rotor 1 PWM

  • w2 — Rotor 2 PWM

  • w3 — Rotor 3 PWM

  • w4 — Rotor 4 PWM

  • Tilt1 — Rotor 1 tilt PWM

  • Tilt2 — Rotor 2 tilt PWM

The default fixed wing control bus consist of the following signals:

  • dA — Aileron angle in Radian

  • dE — Elevator angle in Radian

  • dR — Rudder angle in Radian

  • dT — Throttle control for rotor 1 and 2 in fixed wing flight

If you modify the control surface and rotor layout, you must adjust the output bus interfaces for fixed wing and rotor control accordingly using the exampleHelperDefineDigitalTwinInterface helper file.

Open the defineDigitalTwinInterface.m.

edit('exampleHelperDefineDigitalTwinInterface.m')

Customize Flight Mission

You can customize your flight mission using mission modes that the Path Manager block supports.

The mission modes, action, and the corresponding VTOL UAV flight mode is summarized in the following table.

Mode

Action

Supported Flight Mode

1

Vertical Takeoff

Hover

2

Waypoint Following

Hover, Fixed Wing

3

Orbiting Waypoint

Hover, Fixed Wing

4

Vertical Landing

Hover

6

Transition Between Hover and Fixed Wing Mode

Hover, Fixed Wing

Note that mode 5 is omitted because it corresponds RTL mode which is not used in this model.

Use the exampleHelperTransitionMissionData helper file to create a VTOL UAV mission. By default, the helper file contains a mission with the following parts:

  1. Takeoff vertically

  2. Hover to two waypoints

  3. Transition to fixed-wing flight mode

  4. Fly to a waypoint

  5. Orbit a waypoint

  6. Transition to hover flight mode

  7. Land vertically

Open the exampleHelperTransitionMissionData.m

edit('exampleHelperTransitionMissionData.m');

Customize VTOL UAV Control in Mission Phases

The guidance mission test bench enables you to customize the control for each flight phase.

Control Modes

You can customize each flight mode of the VTOL UAV by selecting which control mode to activate. To change the control mode, you must set controlMode within the Guidance stateflow subsystem to see the effect on the flight path.

You can enable or disable any of these control parameters by setting the value of the parameter to 1 to enable controls and 0 to disable controls.

lateralGuidance — Course control in fixed wing mode. Disable during transition to minimize lateral motion.

airspeedAltitude — Airspeed and altitude control in fixed wing mode. Impacts setpoints of inner-loop attitude controller. This can be disabled to test performance of attitude controller.

attitude — Attitude control in fixed wing mode. This control mode stabilizes the VTOL UAV in transition to fixed wing flight.

inTransition —Flag that messages autopilot that aircraft is in transition. Affects tilt scheduler and controllers within autopilot.

TransitionCondition — Allows autopilot to determine when it is safe to fully switch to fixed wing control in transition.

Customize the control mode by adding more parameters by redefining the controlMode bus in defineCtrlInterface.

Customizing Command Setpoints

You can also customize the input setpoints of the autopilot. For example, the AAC (Airspeed Altitude and Course) bus is given below.

When you modify the bus interfaces, you must also set the corresponding values within the Guidance Mode Selector Stateflow chart.

Open the Guidance Mode Selector Stateflow chart and set the bus definitions of the buses accordingly.

blockpath = Simulink.BlockPath(["VTOLTiltrotor/Autopilot/Controller", ...
    "VTOLAutopilotController/Guidance Test Bench/ControlType/Guidance Testbench/Guidance Logic/Guidance Stateflow/Guidance Mode Selector"]);
open(blockpath);

Select MODELING > Symbols Pane > Property Inspector to examine bus interface.

When customizing the inputs to autopilot, you must also redefine the inputs for manual control inside the Manual Control subsystem in Guidance Testbench.

Summary

This example provides a walk through on how to customize and integrate custom modules for your application.

References

[1] N., Pavan. (2020). Design of Tiltrotor VTOL and Development of Simulink Environment for Flight Simulations.

[2] Mathur, Akshay & Atkins, Ella. (2021). Design, Modeling and Hybrid Control of a QuadPlane.

[3] Ducard, Guillaume Jacques Joseph and Minh-Duc Hua (2014). Modeling of an unmanned hybrid aerial vehicle.

See Also