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