130mm quad with simple C++ firmware, Part I: The Build

I wanted to try my hand at a true "DIY" project, designing and building my own micro quadcotper frame and writing my own firmware in C++.  In this post I will describe the frame and build; in my next post I will talk about the firmware.

Excluding stuff I had lying around the shop, (heat-shrink tubing, EC-3 connectors, velcro, cable ties, etc.) the cost came to just under $170:

Here's the frame, fresh out of my LulzBot Mini printer:

Before adding any components, I inserted a velcro tie to keep the battery in place:

Here's the amazing RMRC BLHeli 4-in-1 ESC with motors and EC-3 battery connector soldered on:

Here's the BLHeli mounted on the frame.  I should've used the thinner (4.5mm) standoffs on top and bottom to avoid damaging the circuit!

Next it was time to make a custom jumper for the tiny 3V FrSky-compatible CPPM receiver, which is not 5V tolerant.  I un-soldered the 3V Spektrum header from the Flip32 and jury-rigged a little three-pin jumper connection:

Here's the super-tiny FrSky-compatible receiver from Curtis "Beef" Fissel (of Beef's Brushed Board fame). This photo shows the receiver after I soldered on a three-pin header, solder-bridged the bind pads, connected it to the Flip32, powered the Flip32 through the USB port bound the receiver to my Taranis, and un-soldered the bridge:

You can see the completed project at the top of this post.  Although I could have used Baseflight or Cleanflight to configure the board, I used my own C++ firmware, adapted mostly from Baseflight.  Having never configured such a tiny vehicle before, I struggled for a while with the PID settings.  Eventually I just divided all the default values by two, and that worked fine, giving me the smooth flight shown in the video.

In a follow-up post I'll discuss the C++ firmware that's flying the 'copter.

Views: 7744

Comment by benbojangles on May 17, 2016 at 4:37am

nice frame find. Most people don't realise that the most common 3D printers have a limited print diameter of about 180mm so this fits without having to slice it into pieces.

Comment by benbojangles on May 17, 2016 at 4:38am

oops the frame link ain't working anymore :(

Comment by Patrick Poirier on May 17, 2016 at 8:16am

Cant wait to get the new SimonFlight Stack :-)

Comment by Phillip Schmidt on May 17, 2016 at 11:51am

Nice build... now I want one.

I assume this will be coming in a future post, but any hints on what you are changing in your version of Base/CleanFlight?

Comment by Simon D. Levy on May 17, 2016 at 12:02pm

@Patrick,Phillip: As you'll see (probably this evening), I don't have a branch/fork/release of Baseflight/Cleanflight.  I stripped the Baseflight firmware (around 16K lines of C) down to around 1100 lines to support the minimal kind of old-school firmware I loved from the Arduquad days: IMU + RC + PID controller. Then I wrapped it in a crunchy C++ coating for Arduinoheads like me ;^)  It's an education / research tool more than anything.

Since I mostly ripped the code from Baseflight, calling it SimonFlight would be dishonest.  So I'm calling it .. Hackflight!

Comment by Simon D. Levy on May 17, 2016 at 12:08pm

@benbojangles: Sorry about the thingiverse link.  I just checked and it appears to be publicly available now.

Comment by Patrick Poirier on May 17, 2016 at 12:14pm

Yeah .. Better keeping this option for the Gazebo Plugin == Sim -On - Flight :-)

Getting back to the root seems to be the trendy these days, I really enjoy hacking and flying micro drones with this group: http://www.rcgroups.com/forums/showthread.php?t=2512604

And incidentally, Iam waiting for a NAZE32 clone to retrofit my quad 250 project, so timing is good :-)

Comment by Simon D. Levy on May 17, 2016 at 12:48pm

@Patrick: Great minds think alike (and so do you and I!) ... instead of Gazebo, my students and I used V-REP to code up a Python-based simulator. So my other goal for the week is re-writing the flight controller for the sim, using the Hackflight firmware.

The Eachine hack is schweet!  But as soon as I see the Keil toochain, ST-link, MDK and all that, I run screaming from the room ;^)  Here's the complicated procedure I prefer:

 % make flash

For debugging I get by with printf().  I gladly accept the label of Primitive Savage that goes with this among many engineers.

Comment by Phillip Schmidt on May 21, 2016 at 9:19pm

Do you have a guess as to where you throttle is at hover?  I ask as simulations show that a 2s battery with that motor and prop may hover at ~80% throttle.  Even with the added weight, 3s and 4s batteries show throttle at hoover much closer to 50%.  Given how small this is, it seems possible that the simulation just doesn't represent it well.

What is your flying weight?

Thanks,  Phillip

Comment by Simon D. Levy on May 22, 2016 at 11:07am

Flying weight is 150g.

I just tested on a full charge (2S battery), and got the vehicle to hover at around 55% throttle -- which agrees with your 50% figure, rather than the 80% you get from simulation.


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

Join DIY Drones


Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2020   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service