Design and Tune Controller for VTOL UAV
This series of examples shows you how to design and tune a Vertical Takeoff and Landing (VTOL) UAV controller by using a reference application template as a MATLAB® Project. For more information about MATLAB Projects, see Create Projects.
This reference application models the VTOL UAV in a tilt rotor configuration. In this configuration, the VTOL UAV operates two rear fixed rotors, two tilting front rotors, and a wing. This configuration enables the VTOL UAV to take off and land vertically without the need of a runway like a multicopter, while attaining a relatively high cruising speed by transitioning a to fixed wing configuration.
Continue to VTOL UAV Model Overview to get an overview of the VTOL UAV Model. To see the VTOL UAV in action, continue to Simulate Your First VTOL UAV Flight.
Once you are ready to start the VTOL UAV control design process, navigate to any of the examples in this example series.
VTOL UAV Control Design Steps
This example series shows you how to tune a VTOL UAV controller for all phases of mission in urban environment, such as hover flight, fixed-wing flight, and transition between those two phases. This series also shows you how to deploy the controller that you have designed into a Hardware-in-the-Loop (HITL) simulation using PX4® flight controllrt, and how to visualize the simulation in 3D environment using Unreal Engine®
Visit these links for more details on each section of the example series.
Open VTOL UAV Project and Model
The VTOLRefApp.prj
project file contains the Simulink® model, supporting files, and project shortcuts that this example series uses.
First run openExample('uav/DesignAndTuneControllerForVTOLUAVExample')
in the command window to access the directory which contains the project file, then run this code to open the project file.
% Open the Simulink project. prj = openProject("VTOLApp/VTOLRefApp.prj");
Open the Projects tab and view the shortcuts.
Click Open Model shortcut to Open the VTOLTiltrotor
Simulink model and explore the model.
The VTOLTiltrotor
Simulink® model contains these five main subsystems that you can customize in accordance with your design:
Ground Control Station
– Commands the VTOL UAV to execute a set of maneuvers to complete a mission.Autopilot
– VTOL UAV flight controller which contains theLow level controller
andGuidance test bench
subsystems. TheGuidance test bench
subsystem contains a high level controller which calculates the setpoint of the low level controller during various flight modes, such as takeoff, forward transition, waypoint navigation, orbit, backwards transition, and landing. In addition, the logic determines the conditions in which the modes change during the mission.Manual Control Dashboard
– Use this subsystem to manually control the VTOL UAV. Before using this subsystem, you must enable manual control mode of the test bench by using the Manual Mode shortcut.Digital Twin
– VTOL UAV plant model. This subsystem contains the dynamic, aerodynamics and propulsion model of the VTOL UAV.Visualization
– Visualize the VTOL UAV flight.
Simulate Your First VTOL UAV Flight
To see the VTOL UAV in action, simulate VTOL UAV flight with manual control in hover configuration. Set up the VTOL UAV plant and enable the hover configuration by clicking the Set up Plant button in the project shortcuts, or run the setupPlant
helper function.
setupPlant;
Initialized VTOL model. Enabled hover configuration. Enabled hover guidance mission.
To enable manual control, click Manual Mode under the Hover section in the project, or use the setupHoverManual
helper function.
setupHoverManual;
Enabled hover manual testbench mode.
Run the VTOLTiltrotor
Simulink model, and navigate to VTOLTiltrotor/Manual Control Dashboard
subsystem.
Adjust the sliders in the Hover Commands
section and observe the flight response of the UAV in hover configuration.
Observe that the UAV follows the manual setpoint. However, this not sufficient to confirm the UAV's ability to follow all mission trajectories because it is possible for the UAV to enter a highly non-linear regimes when the mission's trajectory is complex.
Before resuming to other examples in this example series, you must close the VTOLRefApp.prj
Simulink project by running this command in the Command Window:
close(prj)
For an example on how to verify the ability of the UAV to follow a more complex trajectory and tune the controller gains to improve the tracking performance in hover mode, visit Tune Control Design for VTOL UAV in Hover Configuration.