Hi all,
I'm sharing my custom flight controller code written for the Teensy 4.0/4.1 and MPU6050/9250 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."
I started this project out on the Arduino nano, but wanted a lot more headroom/horsepower--that's when I discovered the Teensy 4.0 with cortex m7 which has been absolutely fantastic. Finally I was able to code a flight controller my non-coding brain can understand and easily modify for all my weird flying contraptions--and to be able to run a flight control loop rate of 2kHz with plenty more computing power to spare is just awesome.
Download: https://github.com/nickrehm/dRehmFlight
Features:
I owe a special thanks to Brian Taylor (who I see is still very active on this forum) for his SBUS, MPU6050, and MPU9250 libraries which made the current version of this project possible. Original code only supported PWM and PPM receivers and the MPU6050 over I2C, but some overhaul in the newest version added the 9250 and SBUS compatibility thanks to the bolderflight libraries.
Here is my favorite project running this code:
Anyways, I'm sold on the Teensy. This thing is just so dang powerful and easy to use that it'll be my go-to from here on out. Cheers
I'm sharing my custom flight controller code written for the Teensy 4.0/4.1 and MPU6050/9250 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."
I started this project out on the Arduino nano, but wanted a lot more headroom/horsepower--that's when I discovered the Teensy 4.0 with cortex m7 which has been absolutely fantastic. Finally I was able to code a flight controller my non-coding brain can understand and easily modify for all my weird flying contraptions--and to be able to run a flight control loop rate of 2kHz with plenty more computing power to spare is just awesome.
Download: https://github.com/nickrehm/dRehmFlight
Features:
- 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.
- 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.
I owe a special thanks to Brian Taylor (who I see is still very active on this forum) for his SBUS, MPU6050, and MPU9250 libraries which made the current version of this project possible. Original code only supported PWM and PPM receivers and the MPU6050 over I2C, but some overhaul in the newest version added the 9250 and SBUS compatibility thanks to the bolderflight libraries.
Here is my favorite project running this code:
Anyways, I'm sold on the Teensy. This thing is just so dang powerful and easy to use that it'll be my go-to from here on out. Cheers