This video  shows the maiden flight of my new brushed quadrotor, a “totally DIY" project using my own C++
firmware  (Multiwii clone with hardware abstraction), 3DFly
3D-printed frame, and, best of all, a 32-bit brushed-motor flight controller that I built from a Teensy 3.2 board. Why build your own brushed flight controller, instead of using one of the many excellent commercial FCs available today?

Apart from the educational value and satisfaction of building something yourself, I was frustrated by the the limited signal pinout on the commercial off-the-shelf (COTS) boards. Inspired by the work of  Geof Barrows with the Crazyflie platform, I wanted to be able to connect an I2C or SPI sensor to my brushed flight controller, while still using a standard R/C transmitter / receiver. Like many others, I am also drawn to the Teensy/Arduino platform because of the enormous variety of code libraries available for it. By the time you hear about a new sensor, there's likely already Arduino support for it. Finally, I had spent a significant amount of time developing my own hardware-independent C++ firmware , which I already had working with COTS flight controllers on a brushless-motor quad, a brushed quad, and even a DIY simulator. So I was reluctant to buy into another open-source project like the (admittedly awesome-looking) Crazyflie, with its own firmware, radio, base-station software, etc.

The photo below shows one of my earlier attempt to build an FC using a Teensy board and a standard MPU6050 Inertial Measurement Unit (gyro/accelerometer) breakout board. It's obviously much too big for a brushed copter,and I had such poor results using it on one of my brushless vehicles that I gave up, and returned to trying out COTS solutions.

Then I stumbled across the Pesky Products store on Tindie. Not only was there a cutting-edge IMU shield (with  magnetometer and barometer) suitable for mounting on a Teensy; there was also a shield for turning PWM signals into  rushed DC-motor voltages. Thirty-six bucks and a few days later, I had them in my shop. I soldered pin sockets on the Teensy and pin headers onto the two shields, then soldered a female 1.25mm micro JST connector to each of the four motor through-hole pads on the motor shield. For battery power I cannibalized the power cable on an old Hubsan X4, soldering female jumpers onto the ends (though I subsequently discovered that you can get even these cables on Amazon!) This allowed me to use the standard set of 8.5mm motors and 3.7V battery for this vehicle.

I modified the Pesky Products IMU code to work with my firmware, and then used my own Arduino PWM input library to access the radio signals on my FrSky VD5M receiver. To flash the firmware and test the motors and the receiver signals, I made up a no-power USB cable following the “Option #2: Cut the Red Wire” directions for the Teensy (No, the RED wire!!!)  Several iterations of modify/flash/test later, it was up and flying.

Although the all-DIY quad has about the same gross weight (60g) as the equivalent vehicle with a COTS board, the DIY version is much bulkier. It also doesn't take advantage of the awesome FrSky-compatible micro PPM receiver that I prefer for indoor vehicles; so, instead of one signal wire from the receiver, I need four (or five, for the auxiliary switch). So now that I have a flying prototype, my next steps are:

  1. Get another Teensy, IMU, and DC motor board and mount them together directly with pin headers for a much flatter profile.

  2. Get the micro RX working with an existing Arduino PPM library. I nearly got it working with this library, but I was doing something wrong, because when I powered up the motors, the throttle and yaw signals would swap values with each other intermittently (Yipes!)

One I've done that, I'll do a proper build post, then start comparing flight times and current draw against a COTS board. No data on that yet, but my impression is that the DIY board flies maybe a half or a third as long on the same battery. (I've also ordered a compatible battery  with twice the charge, which should improve things – and this time I ordered the one with the correct polarity!)

Meanwhile, the firmware is on github if you want to look it over.

Views: 2377

Comment by Gisela & Joe Noci on October 7, 2016 at 11:16pm

Now that's the DIY spirit! Beats the rest hands down!

Well done.

The Nampilot

Comment by John Arne Birkeland on October 8, 2016 at 6:40am

F.. you. I was blissfully unaware of that Tindie site until you mentioned it. This is going to ruin me and require even more work and storage space for projects.

Teensy boards are great and have been my go to solution for a long time now, having the perfect balance between size and features for DIY.

And btw, very nice project. :)

Comment by Patrick Poirier on October 8, 2016 at 7:17pm

Hello Simon,

WOW , you allways have  a real DIYer project on the back-burner, thanks for the inspiration :-) 

Is that the Brushed Motor ''Solid as a rock'' version you are flying here ?

These motors seems unusually big compared to my 8025 , can you tell what the model and how you are driving them with the Teensy, (my guess would be IRLML2502) ?

Comment by Patrick Poirier on October 8, 2016 at 7:19pm

I mean brushed 8.5 x 20 mm

Comment by Simon D. Levy on October 8, 2016 at 8:47pm

Thanks, Patrick!  Yeah, that's the "solid as a rock" 3DFly rig from GetFPV, but with my own flight controller instead of Beef's Brushed Board.  (I love the BBB, but as I said in the post, these COTS flight controllers are designed for FPV / racing, not mad-scientist experimenting).  As for motors: I couldn't find the 3DFly motors sold separately on GetFPV, so I bought these, which appear identical.  I am driving them with the awesome Teensy DC motor shield from Pesky Products.  Here is his description of the circuit / diodes:

The PWM pins from the microcontroller drive the gate voltage on the four PMV31XN mosfets, allowing the VIN to be delivered to the motors in increments of the PWM output (from 1/256 to 255/256) individually adjustable for each motor independently .... I have added a second design with the same form factor and function but using 0402-size components including: resistors, FemtoFets (TI's CDS13383F4T 1 mm x 0.6 mm MosFets), and SBR05U20LP 1 mm x 0.6 mm diodes.

By following his description, I was able to translate motor PWM from my firmware into DC analog voltage very simply.

I'm also really psyched about the forthcoming Teensy 3.5/3.6.  Like the move from STM32F1 (Naze32 and clones) to STM32F4 (OpenPilot Revolution and clones), this is a move from 72MHz all-integer computing (ARM Cortex M3 generation) to 180 MHz with floating-point support (M4 generation).  Unlike the STM32 boards, however, Teensy does not require learning to work with any new libraries.  

Comment by Simon D. Levy on October 8, 2016 at 9:28pm

I forgot to include Pixhawk in the list of STM32F4 flight controllers!

Comment by Patrick Poirier on October 8, 2016 at 9:42pm
Yeah but pixhawk is sitting on nuttx, and as i can see you are a baremetal rocker ;-)
Thanks again for your generous and informative reply, I will certainly switchnone of my cleanflight to hackflight this winter. Theses days i am into deep learning and tensorflow...amazing stuff for mad-scientist ;-)
Comment by Simon D. Levy on October 8, 2016 at 9:48pm

You are correct, Patrix: I am running deeznutz, not nuttx ;^)

Deep learning: I taught a course on this last winter.  The textbook author switched from Theano to TensorFlow while I was teaching it!  These days I am excited by neurally-inspired vision chips, like the stuff that Geof Barrows works on, and also the new Myriad 2 processor from Movidius -- though now that Intel has acquired them, they don't seem to be moving forward with their plans to sell it directly to developers :^(

Comment by Patrick Poirier on October 8, 2016 at 10:01pm
Yeah I know...keep my fingers crossed, and hope it will pop-up on the Aero platform at a reasonnable price.... Otherwise it will be Nvidia TX1, but the pricetag is pretty high for a self driven pokemon chasing drone!!!
Comment by Simon D. Levy on October 8, 2016 at 10:19pm

We bought a TX1 for the deep-learning course, but we didn't have much success with it.  Unlike RPi or ODROID, the TX1 required a complicated firmware-flashing process (firmware?  for $600 full-up computer?!), and the host computer had to be running a specific release of Ubuntu.  We did manage to get Theano running on it, but it was significantly slower learning than on the NVIDIA GPUs on our HP desktop boxes.  So although I'd be delighted if someone could show me how to get my money's worth out of my TX1 on a quadcopter, the whole thing looks more like a marketing stunt to me: "deep learning + drones = AWESOME".   Indeed, googling NVIDIA TX1 DRONE yields links to press releases for the top four hits.  

I think that the approach that these guys took makes more sense: collect the visual data, use it to train a deep-learning classifier  on a desktop computer (with NVIDIA GPU / CUDA), then run the classifier on an ODROID mounted on the vehicle.


You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2017   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service