dRehmFlight VTOL

Teensy/Arduino Flight Controller and Stabilization

Similar projects worth following
dRehmFlight is the flight controller for hobbyists, hackers, and non-coders interested in stabilizing their wacky and unique flying creations. The code and supporting documentation is built to bring someone up to speed on VTOL flight stabilization concepts as quickly and painlessly as possible. The code is written and presented in a way that is intuitive, easy to follow, and most importantly: all in one place. No more digging through countless folders and confusing classes just to add an 'if' statement for your custom drone application. This flight controller uses an Arduino-compatible microcontroller, so there is no confusing flashing or compiling process necessary. If you can use Arduino, you can start expanding the capabilities of this flight controller to your liking. Download the complete code and documentation here:


dRehmFlight has been used as a teaching tool for aircraft stabilization and flight control principles in universities and tech companies around the world. It is not meant to out-perform other flight controller packages on the market, or be used in a commercial sense. It is best suited for rapid prototyping or allowing a radio control hobbyist to get their feet wet in flight control code for their VTOL drone project. Much more information is included in the dRehmFlight VTOL Documentation .pdf.

  • Code modifications and compiling done within the Arduino IDE with Teensyduino add-on.
  • Default code supports 6 ESC outputs using OneShot125 Protocol, and 7 conventional PWM outputs for ESCs or servos, with the ability to modify the code for extra outputs for custom setups.
  • Support for conventional PWM, PPM, or SBUS receivers.
  • MPU6050 and MPY9250 IMUs supported.
  • Easy to use control mixer with stabilized axis variables and ability to pass direct, unstabilized commands to the motors or servos direct from the transmitter.
  • Three PID controller types including rate and angle-based setpoint.
  • Simple variable fading, with support for more advanced options planned in the future.
  • Default hardware setup (Teensy 4.0 and MPU6050 IMU) costs less than $30 and weighs less than 15 grams.
  • Comprehensive documentation with explanation of every function and variable, as well as tutorials for setting up the hardware and modifying the code for your application.

Feature Requests and/or Planned Updates:

  • More fading options
  • Many more!

dRehmFlight VTOL Documentation.pdf

Tutorials, How-To's, and general overview of the code

Adobe Portable Document Format - 22.96 MB - 07/30/2022 at 00:52


View all 7 components

  • Optimizing a VTOL

    Nick Rehm03/29/2023 at 23:41 0 comments

    Always happy to help up-and-coming youtubers with their projects! 

  • V-22 VTOL Model

    Nick Rehm03/31/2021 at 02:49 0 comments

    Check out this awesome project running dRehmFlight VTOL, by Brian Jones:

    This model uses two 450 helicopter rotor kits with full cyclic and collective control, easily programmed for stabilized flight with dRehmFlight's easy to understand control mixing and code modifications. Fingers crossed for successful transition!

  • How the Flight Controller Code Works

    Nick Rehm02/07/2021 at 16:42 0 comments

    Here is a pretty long video walking you through the structure of the code, where I point out things that are important to know if you would like to modify the code for your application:

  • IMU Configuration Tutorial Video

    Nick Rehm01/28/2021 at 15:39 0 comments

    Here is a quick tutorial on first-time setup of the IMU as well as some tips on mounting for the best performance:

  • Showcasing dRehmFlight's Versatility

    Nick Rehm11/11/2020 at 02:07 0 comments

    I wanted to show my process of building a VTOL vehicle and implementing this flight controller to stabilize it in the air. I decided to build the famous SpaceX test vehicle: Starhopper. Modifying the code for this unique hovering platform took less than 2 minutes (skip to 3:12 for code modifications): 

    You can follow along with my Starship program progress on it's own Hackaday Page.

  • Test Platform + Data Logging

    Nick Rehm10/25/2020 at 19:03 0 comments

    Hi all,

    I've been very busy lately, but have managed to get a test quadcopter thrown together to test new features and improve the code:

    I am using the SparkFun OpenLog to print data to a spare serial pin on the Teensy, which is then dumped into an SD card as a .txt file onboard. Super simple!

    Here is some sample data showing the control response. Overall, I am very happy, but this data is already giving me ideas on how to squeeze out even more performance!

  • Radio Connection Tutorial Video

    Nick Rehm10/12/2020 at 15:47 0 comments

    Here is the next tutorial in my series for dRehmFlight VTOL: Setting up your radio connection. dRehmFlight VTOL currently supports PWM, PPM, and SBUS type receivers of any brand. My goal with these videos is to provide a resource that I wish I had when first starting off. Let me know if this helps you in any way!

  • Beta 1.2 Released!

    Nick Rehm10/01/2020 at 13:56 0 comments

    Hey Everyone,

    I've been working hard on getting 1.2 put together and documented. I had a few setbacks over the past week or so, but now we're here. Some updates:

    • SBUS receiver support
    • MPU9250 support
    • New IMU/radio selection: simple defines in beginning of code
    • IMU gyro and accelerometer scale selection: up to +/-2000 deg/sec and +/-16 Gs
    • Added switchRollYaw() function (see documentation for details)
    • Added printServoCommands() function
    • Switch between controller types with a logical statement in the main loop
    • Minor bug fixes & tidying up

    I highly recommend you check out the updated documentation. For expedited setup, check out the "General Instructions for First-Time Setup" tutorial at the end of the document to get up and running as fast as possible.

    The MPU9250 integration was difficult to say the least, but I think I finally got it working. The MPU9250 requires some special attention when it comes to soldering up with the Teensy as well as adjusting some filtering parameters for it. You'll also have to do some calibration, but that is as simple as uncommenting a function at the end of the void setup() and performing the calibration by rotating the IMU for a minute or so. Check out the "MPU9250 Integration" tutorial for more information on everything to do with the MPU9250. I will still HIGHLY recommend sticking to the MPU6050, as that is the IMU that this code was originally built around.

    There were some small bugs that were fixed. You can now seamlessly switch between controller types (angle or rate) in the main loop with a logical statement should you code that in. Also fixed an error/bug with processing the IMU data.

    Speaking of the IMU data, I need to thank jihlein on RcGroups for his amazing help overhauling the IMU data gathering (enabling MPU9250 use too). He is responsible for the new define section at the beginning of the code that makes selecting IMU, IMU data scales, and receiver type extremely easy to do. So big thanks to him!
    One thing you will now need to do is copy the required libraries (included in the dRehmFlight download) and paste them in your Arduino libraries folder. More details in the 'Software Setup' section of the documentation.

    Looking forward to seeing some of you get flying!

  • Default Hardware Tutorial Video

    Nick Rehm09/17/2020 at 18:54 0 comments

    Here is the first of (hopefully) many tutorial videos rolling out for dRehmFlight VTOL: Setting up the recommended default hardware. This video will show you how to solder the board together for full i/o capability with the default code.

  • Rcgroups Support Thread

    Nick Rehm09/14/2020 at 20:12 0 comments

    Hi all,

    Here is the Rcgroups forum thread for all things dRehmFlight:

    Feel free to ask questions here, share your setup, or get more information from other people sharing their experience with dRehmFlight.

View all 11 project logs

  • 1
    Download The Docs

    Everything you need to know is included in the dRehmFlight VTOL Documentation.pdf document!

View all instructions

Enjoy this project?



p s wrote 08/30/2022 at 12:26 point

Is there a need to have two different IMU offsets or calibrations for VTOL vs cruise mode when working on a transitioning VTOL like the biplane? I have modified the code for different motor mixes where roll and yaw swap but I don't know if anything else needs to be changed. Yet to upload and try the code. 

  Are you sure? yes | no

dfmcwhir wrote 02/25/2021 at 01:33 point

This is cool, I will have to play around with it. I tried making a VTOL quad awhile ago, but one of the problems I ran into was that I needed to figure out a way to change the code so that controls are swapped after transitioning to forward flight from vertical takeoff. It seems like your code might be easier to figure out how to do that. 

What I wanted to test was a VTOL quad wing that has no moving control surfaces, tilting rotors,  or servos. All the control during forward horizontal flight is done by 4 "lift" motors. One of the problems with that is yaw for a quadcopter flying vertically is switched to roll or "ailerons" when it is flying horizontally.

This took off and hovered fine as a quadcopter and I did get a short (~50ft) forward, horizontal flight with it, but then crashed it. I did a rebuild, but changed up the design a little and that one didn't even want to hover. I haven't gotten around to trying a 3rd time.

  Are you sure? yes | no

Nick Rehm wrote 02/25/2021 at 02:47 point

Yep, have done exactly that before:

Ignore the control surfaces, they just supplement control in forward flight. I did exactly what you described flipping the controls for roll and yaw in forward flight. Good luck!

  Are you sure? yes | no

dfmcwhir wrote 02/25/2021 at 05:17 point

Cool, that is exactly what I want to do. I might try again here when the weather is better. I don't think I have a Teesny 4 on hand (I think I just have the Teensy 3, I got it a long time ago), so I will have to order one. Although I'm kind of curious if it would run on an ESP32. I downloaded your code and swapped the servo library to the ESP32Servo library and it compiled without error. I wonder if it would run?

  Are you sure? yes | no

Elliot Williams wrote 10/01/2020 at 16:15 point

This is crazy awesome.  And I really like your emphasis on the bare-bonesy code, made for hacking.

Can't wait to get some time to dig into it.

  Are you sure? yes | no

Nick Rehm wrote 10/04/2020 at 18:28 point

Glad you enjoy that aspect. Don't hesitate to reach out once you get started 

  Are you sure? yes | no

Kevin Roach wrote 09/27/2020 at 20:29 point

What jet is that in the pictures? Is there instructions to build one?

  Are you sure? yes | no

Nick Rehm wrote 09/27/2020 at 21:18 point

I'll be releasing plans for the F-35 and the slightly modified flight control code used to make it fly in the future. In the meantime, you can find more information on it here:

  Are you sure? yes | no

Ted Grant wrote 09/18/2020 at 19:52 point

Awesome, amazing, wonderful work!!!

  Are you sure? yes | no

Jacob David C Cunningham wrote 09/15/2020 at 04:43 point

wtf I did not know those "spinning wing" designs could do VTOL that's rad

  Are you sure? yes | no

Nick Rehm wrote 09/15/2020 at 12:25 point

Yep cyclos are pretty cool and have some unique advantages over conventional rotors because of the uniform velocity field over the blades

  Are you sure? yes | no

Mike Szczys wrote 09/14/2020 at 21:01 point

Bad news for you Nick... despite your assertion in the video, this project shows you are now "a coding guy".  :-D   I think doing a few tutorial videos as you mention at the end is a great way to help get others up to speed quickly with this, I'm glad you've made it open source!

Nice to see someone taking advantage of the 600 MHz clock speed of that Teensy 4. I wonder if @Paul Stoffregen has seen this project yet?

  Are you sure? yes | no

Nick Rehm wrote 09/15/2020 at 03:14 point

Hahah thanks! My code is definitely 'sloppy' and in many places redundant, but the beauty of the Teensy is that it doesn't matter. Tutorials coming soon!

  Are you sure? yes | no

Dan Maloney wrote 09/14/2020 at 20:24 point

Ambitious project, hats off to you for tackling it. Looking forward to seeing this rolled out into all sorts of interesting aircraft.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates