Thread Tools
Sep 11, 2020, 12:43 PM
Certified Nerd
Thread OP
Cool

dRehmFlight VTOL - Teensy Flight Controller and Stabilization


Name: logo.png
Views: 10
Size: 26.1 KB
Description:

Current Version: Beta 1.1 - Testers Needed!

dRehmFlight VTOL is a simple, bare-bones flight controller intended for all types of vertical takeoff and landing (VTOL) vehicles from simple multirotors to more complex transitioning vehicles. dRehmFlight was created with those of us in mind who may not be proficient at coding, but want to get an advanced VTOL platform requiring custom mixing in the air relatively quickly. The goal is to have an easy to understand flow of discrete operations that allows anyone with basic knowledge of coding in C/Arduino to peer into the code, make the changes they need for their specific application, and quickly have something flying. The Teensy 4.0 board used for dRehmFlight is an extremely powerful microcontroller that allows for understandable code to run at very high speeds: perfect for a hobby-level flight controller.

Code Download: https://github.com/nickrehm/dRehmFlight


dRehmFlight VTOL - Teensy Flight Controller and Stabilization (5 min 19 sec)


Features:
  • 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 receiver type or smaller PPM-type receivers.
  • 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 Gy-521 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.

Name: FC Assembly.PNG
Views: 24
Size: 2.78 MB
Description:


Feature Requests and/or Planned Updates:
  • Support for MPU9250 9DOF IMU (better attitude estimation)
  • SBUS radio connection
  • Simple switching function for control inputs (e.g. swapping roll and yaw for a tailsitter)
  • More fading options


Vehicles Running dRehmFlight:

VTOL F-35 Parkjet:
Super-Maneuverable RC VTOL F-35 Parkjet (7 min 17 sec)


VTOL F-35 Parkjet (larger):
RC VTOL F-35 Takes Off From Truck (1 min 41 sec)


Quadrotor Biplane:
Quadrotor Biplane RC VTOL (4 min 7 sec)


Dual Cyclocopter:
Cyclocopter outdoor flight in gusty conditions (1 min 55 sec)


Conventional Quadrotor:
VFS MAV Student Challenge - Gate 2 Autonomous Entry (5 min 24 sec)
Last edited by rcjetflyer2; Sep 18, 2020 at 10:57 AM.
Sign up now
to remove ads between posts
Sep 11, 2020, 12:44 PM
Certified Nerd
Thread OP
Tutorial Videos:

Recommended Default Hardware Setup
Building the Flight Controller Hardware - dRehmFlight VTOL (10 min 52 sec)
Last edited by rcjetflyer2; Sep 17, 2020 at 01:52 PM.
Sep 11, 2020, 12:49 PM
Certified Nerd
Thread OP
Hey everyone, you may have seen some of my VTOL projects floating around here lately:

https://www.rcgroups.com/forums/show...ane-VTOL-Plans

https://www.rcgroups.com/forums/show...F-35-Tricopter

Well, I've been busy prepping my flight control code for release, and I think it's finally at a point where I can pass it off to you all. I wanted a simple, bare-bones flight controller that could be easily coded and modified in Arduino for any type of application. The main thing we all want is the control mixing (and ability to assign different flight modes for VTOLs!). This package was developed with that as the main goal from the beginning. I encourage you all to give the documentation and code a look, and maybe consider assembling your own flight controller to put my code to the test. OpenAeroVTOL has been the standard for VTOLs around here, and while my code doesn't quite have the same fading capabilities, it does allow you to easily program your own with a little knowledge of coding with Arduino.

Anyways, this thread is primarily for questions, troubleshooting, or feature requests as I continually update the code. Thanks!
Sep 11, 2020, 06:20 PM
Registered User
Ran D. St. Clair's Avatar
Thanks for doing this. I hope this becomes popular. It should meet a need that has been kicking around for some time now. OAV has run out of gas due to hardware limitations, and the KK2 is essentially obsolete. The Teensy 4.0 will hopefully be around for a long time, and the Arduino platform is very popular. I will be curious to see how many people will push through the learning curve of Arduino coding. I realize it would be considered baby steps to anyone who is a real programmer, but a lot of RC people are not programmers of any sort, especially us old guys. Your work should go a long way to getting us started. I personally hate learning new flight controllers but this one looks like it could be worth the effort. It sure is great to have enough hardware horsepower to create a really stable aircraft, especially as they get smaller, faster, and more responsive.

Thanks!
Sep 11, 2020, 06:43 PM
Certified Nerd
Thread OP
Thanks for the encouragement Ran! Definitely check out the documentation I prepared and let me know where improvements can be made to make things more clear, anything missing, etc.

The goal of this project is to just brute-force a flight controller with simple and easy to follow code--something previously impossible with slower hardware. That seems to have been the barrier between other flight controller software and us RC guys
Sep 12, 2020, 01:31 AM
Registered User
RCvertt's Avatar
Looks good. Extra points from me for crediting Joop Brokking and his YMFC-32 project. Would have been very easy not to as I see such similar omissions done far to often which is unfortunate.

Your quadrotor biplane, how does the FC handle the transition in the code? Do the gyros and accel stay active while hovering and while in forward flight or are they basically deactivated in forward flight when the FC gets near 45 degrees of tilt?

You have any plans to add a magnetometer? Head free mode where it can yaw like crazy but left roll tx input still make the aircraft move left and such? I'm starting to miss not having such features on Joops YMFC-32.
Sep 12, 2020, 09:56 AM
Certified Nerd
Thread OP
When I started way back in January, Joop's code was the first thing I found when looking for decent understandable FC code. Hats off to him for all the work he did, and getting it to work on an Uno.... The only thing I didn't like about his code was the need to write directly to the ports to save some clock cycles to make the code faster. I eventually found the teensy and realized you don't gotta do that anymore haha

For the Qbit I'm just using the rate controller for the whole flight--so forward flight is stabilized too. Channel 6 is monitored to toggle between hover and forward flight. In hover, just basic quad mixing and the servos are centered. In forward flight, I switch the yaw and roll controls (and reverse roll by throwing a negative in front of the roll_des variable) and stabilize the elevons too.

I will be implementing code to support the MPU9250 9DOF IMU in the future. Not sure about head free mode as that will require a new PID controller too. As of now, all the stabilization occurs in the body frame of the aircraft
Sep 12, 2020, 11:15 AM
Registered User
A couple of thoughts about the MPU9250:

1)I think it's at end of life, so it may be difficult to find in the future. Although I thought the same for the MPU6050 and there seems to be plenty of breakout boards with it.........

2)MPU9250 is more sensitive to noise in my experience for what it's worth. The MPU6050/MPU6000 less so.

3)MPU9250 supports the SPI interface, which is faster. There are existing libraries for it which might make life easier.

I have some tiny MPU6050 breakout boards I'll start with, but I also have an MPU9250 breakout. I can work on setting that up if you'd like. I've got a Teensy 3.x on hand, the 4 arrives Monday.

On the RX side of things, I'll start with PPM, but I've also used the SBUS library on the Teensy and can also look at adding that.

Nice work!!
Sep 12, 2020, 11:55 AM
Certified Nerd
Thread OP
Quote:
Originally Posted by jihlein
A couple of thoughts about the MPU9250:

1)I think it's at end of life, so it may be difficult to find in the future. Although I thought the same for the MPU6050 and there seems to be plenty of breakout boards with it.........

2)MPU9250 is more sensitive to noise in my experience for what it's worth. The MPU6050/MPU6000 less so.

3)MPU9250 supports the SPI interface, which is faster. There are existing libraries for it which might make life easier.

I have some tiny MPU6050 breakout boards I'll start with, but I also have an MPU9250 breakout. I can work on setting that up if you'd like. I've got a Teensy 3.x on hand, the 4 arrives Monday.

On the RX side of things, I'll start with PPM, but I've also used the SBUS library on the Teensy and can also look at adding that.

Nice work!!
I have the code for the 9DOF IMU and a spare 9250 on hand but just haven't found the time to try getting it setup and make the code modifications. Thanks for the tips on noise--I'll have to look at tuning filtering parameters for that as well. Let me know if you see any progress with the 9250.

Only reason for no SBUS support (yet) is because I only run spektrum radio...had to borrow my lab's frsky to get ppm working. Hopefully you won't have too much trouble with the PPM channel mappings--I think I made it pretty clear how to make the required changes, but any feedback from your experience is appreciated
Sep 12, 2020, 04:32 PM
Registered User
With PPM, I can either modify the code, or with the Taranis modify the channel output order.

I’ve got the Sbus coded up, will test when the board arrives next week. Once debugged, I can send you a merge request if you’d like.
Sep 12, 2020, 04:43 PM
Certified Nerd
Thread OP
Quote:
Originally Posted by jihlein
With PPM, I can either modify the code, or with the Taranis modify the channel output order.

Ive got the Sbus coded up, will test when the board arrives next week. Once debugged, I can send you a merge request if youd like.
Go ahead and just shoot me an email with your code/modifications ([email protected]) and I will make sure it gets added to the next code release with my other small changes
Sep 13, 2020, 08:03 AM
Registered User
v22chap's Avatar
This looks good ... keeping an eye on this one !
Sep 13, 2020, 09:01 PM
Registered User

Thank you


Thanks for posting the code. I don't supposed you can tell us the hardware on your VTOL jet?
Sep 14, 2020, 08:54 AM
Certified Nerd
Thread OP
Quote:
Originally Posted by Crazy_guy
Thanks for posting the code. I don't supposed you can tell us the hardware on your VTOL jet?
Sure thing:
- 3x lumenier 2350kv 2206 motors
- lumenier 4-in-1 35a esc BLHeli
- Gemfan 5045x3 props
- 1500mah 4s Lipo

Plans for that + the slightly modified F-35 code are next up on my list
Sep 14, 2020, 12:19 PM
Registered User
Could you suggest a supplier and part #’s for the header pin blocks? Got chips ordered. Great design project, well done!! Excellent follow on to KK2. Have used KK2 and your manual is very well done. Far cry from single channel gas tube receivers that I started with in the 60’s.


Quick Reply
Message:

Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Is there a fixed wing flight stabilizer that can control yaw by thrust vectoring? jamieFL FPV Equipment 23 Apr 01, 2018 11:46 PM
Discussion OpenAero-VTOL Flight Controller Introduction Ran D. St. Clair 3D Foamies 0 Oct 05, 2015 03:34 PM