Hover Parrot Minidrone project template and the
parrotMinidroneHover project, which are available in the
Simulink® Support Package for Parrot® Minidrones, enable you to fly a Parrot minidrone. Once the model is deployed, the drone hovers at an altitude of
1.1 meters for a specified flight time before powering off.
Before you begin, make sure that you have licenses for these products:
Control System Toolbox
Signal Processing Toolbox
Simulink 3-D Animation
Computer Vision Toolbox™
Start the Simulink project using either of the two methods:
On the Simulink Start Page, navigate to Simulink Support Package for Parrot Minidrones, and select Hover Parrot Minidrone.
At the MATLAB® prompt, type:
This opens a Simulink project with the
parrotMinidroneHover model and loads the
required workspace variables.
parrotMinidroneHover model in normal simulation
mode. Navigate through the different subsystems to learn about the modeling
hierarchy and quadcopter dynamics. You can also view the Simulink 3-D animation of the model. For more information, see Quadcopter Dynamics.
Once the Simulink project is open, click the Project Shortcuts tab and perform one of the following tasks based on the type of Parrot minidrone connected:
If the host computer is connected to a Parrot Rolling Spider, click Set Rolling Spider Model.
If the host computer is connected to a Parrot Mambo, click Set Mambo Model.
parrotMinidroneHover model, right-click the Flight
Control System reference model, and select Open As
Top Model. The
opens in a separate window.
flightControlSystem model, do not change the
root level input ports, output ports, or the signals through
flightControlSystem model, click the
Deploy to Hardware icon, . After the build process and deployment
is successful, the Flight Control Interface is launched automatically if you
had selected the option Launch Parrot Flight Control Interface
automatically after build in the Configuration Parameters
dialog box in Simulink (see Model Configuration Parameters for Parrot Minidrone).
Before flying the Parrot minidrone with full speed, test the model at low speed by spinning the motors at low power. Open the Flight Control Interface (see Step 1: Open the Flight Control Interface). Drag the PowerGain slider to 20, which sets the power gain of the motors to 20%.
Click START to start the model deployed on the drone. The motors on the Parrot minidrone start. The propellers spin for the time defined as flight duration (by default, the simulation time) and stop.
To prepare the Parrot minidrone for flight, set the power gain of the motors to the highest value (100%). Drag the PowerGain slider to 100.
Before flying the Parrot minidrone (as explained in the next step), adhere to the following safety procedures:
Ensure the safety of people, animals, and property in the vicinity of the flight.
Wear safety glasses at all times.
Place the drone on a flat surface before starting.
Fly the drone only indoors, with an open area greater than 10x10 feet, over a non-glossy floor.
Always be ready to stop the flight. The Flight Control Interface displays the STOP button after the motors on the drone start.
Click START to start the flight of the drone. The motors on the Parrot minidrone start, and the drone performs a vertical take-off to an altitude of 1.1 meters. The drone hovers at this position for the time defined as flight duration (by default, the simulation time), and the motors stop after the flight duration is completed.
To stop the flight before the flight duration is completed, click STOP in the Flight Control Interface.
Perform the flight analysis:
Click Flight Log to download the flight
log. The file
droneFlight.txt is downloaded to
the Current Folder in MATLAB.
Click MAT File to download the MAT-file.
RSdata.mat is downloaded to the Current
Folder in MATLAB.
To enable MAT-file logging, Simulink Coder™ must be installed on the host computer. Additionally, you must enable the options Use Simulink Coder features and MAT-file logging in the Configuration Parameters dialog box in Simulink model (see Simulink documentation)
The data in
RSdata.mat contains various
After successfully flying the Parrot minidrone using the
parrotMinidroneHover model, you can now redesign the
controller logic in Simulink. Deploy your new model on the minidrone by following the same steps,
and start the minidrone flight using the same commands. Always test your model with
a low value of power gain (10–20%) for the motors. After you are confident about the
flight, increase the power gain and run the model on the minidrone.