• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

dRehmFlight VTOL - Teensy (Arduino) Flight Controller and Stabilization

#61
Gonna be stationed up at Flite Fest with a couple hardware kits for sale--first come first serve.

Kits include:
  • Teensy 4.0
  • IMU
  • Angled male header pins
  • Straight male header pins
  • Female header pins
  • Wire
  • Shrink tube
  • Sticker :)

Basically everything for plug-and-play setup after soldering everything up. If you promise to put it in one of your Flite Fest builds, I'll solder it up for you on the spot and help you through the code setup myself. I'll let you take the F-35 up for a spin as well:

 
#62
Hi all,

I'm sharing my custom flight controller code written for the Teensy 4.0 and MPU6050 IMU. The best summary I've been able to prepare thus far:

"dRehmFlight VTOL is a bare-bones flight controller for hobbyists or researchers wanting to get something flying fast with the ability to quickly and intuitively adapt to unique configurations. The Arduino environment makes it easy to make your additions--from basic functionality to sensor integration to custom inner-loop control--without the hassle of dealing with spaghetti code cluttered by features you'll never use."


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

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, 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.

This is not just meant to stabilize multirotors (though it does that really well). Here is an example of what you can do with the stock code after adding ~20 additional lines of code in the provided control mixer:


So, if you know a little bit about Arduino, this project may be for you to get practically any vehicle type stabilized in the air. If you don't know about Arduino--don't worry. Check out the provided documentation (GitHub download) which includes a complete overview of the code as well as detailed tutorials for setting up the hardware and modifying the code for your application. I'm also releasing a video series covering everything (+more) in the documentation:




Code Walkthrough Video: https://www.youtube.com/watch?v=_n5GBudUf5Q&feature=youtu.be

Hope some of you tinkerers find this project useful,

Nick
Two things rcjetflier
one can i use a arduino pro mini instead of the Teensy 4.0?
second can i use the code for a rc helicopter
 

tamuct01

Active member
#63
Two things rcjetflier
one can i use a arduino pro mini instead of the Teensy 4.0?
second can i use the code for a rc helicopter
I doubt that the Arduino has enough speed to run the realtime calculations necessary. The Pro Mini runs at 8/16MHz where the Teensy 4.0 is at 600MHz. It could be used in a helicopter to handle the swashplate mixing. You'd need to write the mixing code yourself in the controlMixer() function. Each swashplate servo output would be a combination of collective, roll, and pitch inputs.
 
#64
I doubt that the Arduino has enough speed to run the realtime calculations necessary. The Pro Mini runs at 8/16MHz where the Teensy 4.0 is at 600MHz. It could be used in a helicopter to handle the swashplate mixing. You'd need to write the mixing code yourself in the controlMixer() function. Each swashplate servo output would be a combination of collective, roll, and pitch inputs.
thanks,i know that i can use a promini as a auto stabilize for a glider