This example designs a waypoint following controller for a fixed-wing unmanned aerial vehicle (UAV) using the UAV Guidance Model and Waypoint Follower blocks from the UAV Library for Robotics System Toolbox.
The example iterates through different control configurations and demonstrates UAV flight behavior by simulating a kinematic model for fixed-wing UAV.
NOTE: This example requires you to install the UAV Library for Robotics System Toolbox®. Call
roboticsAddons to open the Add-ons Explorer and install the library.
The fixed-wing guidance model approximates the kinematic behavior of a closed-loop system consisting of the fixed-wing aerodynamics and an autopilot. This guidance model is suitable for simulating small UAV flights at a low-fidelity near the stable flight condition of the UAV. We can use the guidance model to simulate the flight status of the fixed-wing UAV guided by a waypoint follower.
The following Simulink® model can be used to observe the fixed-wing guidance model response to step control inputs.
fixedWingPathFollowing model integrates the waypoint follower with the fixed-wing guidance model. This model demonstrates how to extract necessary information from the guidance model output bus signal and feed them into the waypoint follower. The model assembles the control and environment inputs for the guidance model block.
The waypoint follower controller includes two parts, an UAV Waypoint Follower block and a fixed-wing UAV heading controller.
The UAV Waypoint Follower block computes a desired heading for the UAV based on the current pose, lookahead distance, and a given set of waypoints. Flying along these heading directions, the UAV visits each waypoint (within the specified transition radius) in the list.
The Heading Control block is a proportional controller that regulates the UAV heading angle by controlling the roll angle under the coordinated-flight condition.
The UAV Animation block visualizes the UAV flight path and attitude. For fixed-wing simulation in a windless condition, the body pitch angle is the sum of the flight path angle and the attack angle. For small fixed-wing UAV, the attack angle is usually controlled by the autopilot and remains relatively small. For visualization purposes, we approximate the pitch angle with the flight path angle. In a windless, zero side-slip condition, the body yaw angle is the same as heading angle.
The next figures shows the flight behavior with a small lookahead distance (5) and a fast heading control (3.9). Notice the UAV follows a very curvy path between the waypoints.
The next figure shows the flight behavior with a large lookahead distance and slow heading control.
This example tunes UAV flight controller by manually iterating through multiple sets of control parameters. This process can be extended to automatically sweep large set of control parameters to obtain optimal control configurations for customized nagivation controllers.
Once the flight behavior satisfies design specification, you could test the chosen control parameters with high-fidelity models built with Aerospace Blockset or with external flight simulators.