Skip to content

iff-gsc/Copter-Dive-Mode

Repository files navigation

Multicopter Dive Mode for Fast Descent

This repository contains the source code for the Dive Mode for fast descents of multicopters (see video).

Video Summary

Flight test

Installation

  • MATLAB:

    • You need MATLAB/Simulink 2023b or later.
    • You also need the following MATLAB toolboxes:
      • Curve Fitting Toolbox (purpose: propeller map interpolation; if you don't have it, you can replace the propeller map interpolation with the simple propeller model in Ref. [1])
      • Simulink Coder, MATLAB Coder (purpose: only for code generation for flight tests; if you don't have it, you can still run the simulations)
  • This repository:
    Clone this project including the submodules LADAC and LADAC-Example-Data:

    git clone --recursive https://github.com/iff-gsc/copter-dive-mode.git
    
  • FlightGear (optional; for visualization):
    You should install FlightGear for visualization.

  • ArduPilot SITL (optional; for ArduPilot SITL and flight tests):

Run Simulation

  1. Open and run init_quadcopter_S500_dive_mode located in init in MATLAB (if it is not on the MATLAB path already, click Change Folder or Add to Path).
  2. The Simulink model QuadcopterSimModel_DiveMode located in models should appear after step 1. Run this model.
  3. Run FlightGear visualization by executing runfg_IRIS.sh (Linux) or runfg_IRIS.bat (Windows) located in the FlightGear folder.

By default the quadrotor will be initialized in hover at 300 meters altitude and will enter the Dive Mode after 1 second.

You can plot the results after simulation by running plot_dive.

Generate C++ Code for ArduPilot Implementation

We use the ArduPilot custom controller interface.

  1. Open and run init_Arducopter_S500_dive_mode located in init in MATLAB.
  2. The Simulink model ArduCopter_DiveMode located in models should appear after step 1. Generate C++ Code: APPS → Embedded Coder → Generate Code.
  3. (optional) Define tunable parameters to be ArduPilot parameters by running apParProcessCodeExport( 'apPar_copter_params_default' ) in the MATLAB Command Window.
  4. Clone the ArduPilot fork and checkout the branch Copter-Dive-Mode:
    git clone -b Copter-Dive-Mode --recursive https://github.com/ybeyer/ardupilot.git
    
  5. Copy and paste the generated code (MatlabController.cpp, MatlabController.h, MatlabController_data.cpp, rtwtypes, MatlabControllerParams.cpp,MatlabControllerStructOverride.h) to the ArduPilot fork in ardupilot/libraries/AC_MatlabController
  6. Build ArduCopter (see next sections).

ArduPilot SITL

  1. Open and run init_quadcopter_S500_ArduPilot_SITL located in init in MATLAB (if it is not on the MATLAB path already, click Change Folder or Add to Path).
  2. The Simulink model QuadcopterSimModel_ArduCopter_SITL located in models should appear after step 1. Run this model.
  3. Run FlightGear as above.
  4. Run the ArduPilot SITL from terminal and specify the S500 copter parameters file (copy it to ardupilot/Tools/autotest/default_params):
    Tools/autotest/sim_vehicle.py -v copter --add-param-file=Tools/autotest/default_params/S500-SITL.parm --model=gazebo -w
    
  5. Take off in any ArduCopter flight mode.
  6. Switch to LindiCopter by entering mode 29 into the ArduPilot SITL terminal.
  7. Activate the Dive Mode by setting the Channel 10 PWM to 2000 (1000 is Stabilize, 1500 is Loiter).

Flight Test

  1. Define your flight controller board (e.g. MatekH743) in terminal in the ArduPilot folder:
    ./waf configure --board=MatekH743
    
  2. Build ArduCopter for your flight controller board:
    ./waf configure --upload
    

About

Fast descent for multicopters by free fall avoiding vortex-ring state

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages