Main Content

Follow Orbit Using Parrot Minidrone

This example shows how to fly a Parrot® minidrone using Simulink® Support Package for Parrot Minidrones by configuring the path planning algorithm to follow an orbit path.

Note: This example requires you to additionally install the UAV Toolbox from MathWorks®.

Prerequisites

Required Hardware

To run this example, you must have the following hardware:

  • Parrot Rolling Spider Or Parrot Mambo minidrone with a fully charged battery and propellers connected to the motors

  • Micro USB type-B cable

  • Bluetooth® Low energy (BLE) 4.0 support on the host computer

Required Products

  • Simulink Support Package for Parrot Minidrones

  • UAV Toolbox

  • Aerospace Blockset™

  • Aerospace Toolbox

  • Control System Toolbox™

  • Signal Processing Toolbox™

  • Simulink 3D Animation™

Model

The support package includes example project that start the flight of Parrot minidrone and follows an orbit follower, for the flight's path.

Open the parrotMinidroneOrbitFollower project that uses an orbit follower by executing this command at the MATLAB® command prompt.

openExample('parrot/FollowOrbitParrotMinidroneExample');

Note: If you are using R2023a or an earlier version of Simulink Support Package for Parrot Minidrones, then you can run the following command at the MATLAB command prompt to launch the project.

  parrotMinidroneOrbitFollowerStart

To access the archived documentation page from previous release, see Follow Set of Waypoints or Follow Orbit Using Parrot Minidrone (R2023a).

Task 1: Configure Orbit Follower and Landing Logic in Path Planning Subsystem

In the parrotMinidroneOrbitFollower Simulink model, the orbit follower and landing logic are modeled inside Flight Control System > Path Planning subsystem. Double-click the Path Planning subsystem to view the logic.

There are two subsystems inside the Path Planning subsystem:

Orbit Follower

The Orbit Follower subsystem contains the Orbit Follower block (from the UAV Toolbox).

This subsystem is used in the parrotMinidroneOrbitFollower project for the following:

  • Define the orbit for Parrot minidrone to follow, by defining the center of orbit (using [x y z] coordinates) and the radius. In this project, we use [0.5, 0.5, -1] as the center of rotation and 0.5 as the radius. These are defined using two Constant blocks connected to the Center and Radius inputs of Orbit Follower block.

Here the z axis value -1 represents the height (1 meter) at which the drone navigates along the orbit.

In the UAV Orbit Follower block, we also set the value of the Turn Direction input as 1. This defines a clockwise movement of the drone along the orbit.

  • Define the lookahead distance of the Parrot minidrone while it is navigating along the orbit. In this project, we use 0.4 meters as the lookahead distance. This value is proportional to the speed at which the drone is going to fly (if you increase the value of lookahead distance, the drone moves fast along the orbit).

  • Update the status once the drone completes four circles. In this project, the NumTurns output of the UAV Orbit Follower block is latched when it reaches a value of 4, and this value is passed to the Landing Logic subsystem to land the drone.

Task 2: Deploy the Orbit Follower Model on Parrot Minidrone

1. In the Modeling tab of Simulink model window, click Model Settings to open the Configuration Parameters dialog box.

2. Go to the Hardware Implementation pane, and select the drone from the Hardware board list - either Parrot Mambo or Parrot Rolling Spider. Click Apply and then OK.

3. In the Hardware tab the Simulink model window, click Build, Deploy & Start. The lower-left corner of the model window displays status while Simulink prepares, downloads, and runs the model on the hardware.

After the model is successfully deployed, the Parrot minidrone takes off from the ground to a height of 1 meter and starts moving along an orbit of radius 0.5 meters. The drone completes the orbit four times, finally initiates the landing logic, and then shuts down the motors when it reaches a height of 0.3 meters from the ground.

Other Things to Try

In the Orbit Follower subsystem, perform the following and observe the changes in the flight of the drone:

  • Change the orbit radius

  • Change the Look ahead distance