Archive for the 'Tinycopter' Category


Tinycopter Rises from Poverty

Jan 20, 2012 in Project Build Reports, Tinycopter

Poor Tinycopter.

But it flies!

… well, okay, only when I’m not at the controls. Years and years of driving fast and decidedly non-holonomic robots  with questionable traction in battle conditions have conditioned me to “OH GOD FULL STICK” as the only method of transmitter operation. This, as flying both Tinycopter and 4pcb have taught me, does not work for aircraft – the overcompensation I apply can clearly be seen in the second half of the video.

Anyways, so why does Tinycopter fly now and not before? Oddly enough, the most important change was not in software:

What is seen above is the four aluminum standoffs that formerly mounted the board replaced by some sections of 1/16″ ID soft silicone tubing.

I was suspicious of one very critical aspect of successful multicopters: sensor vibration/mechanical noise isolation. To me, mounting your IMU on a loop of tape or chunk memory foam seemed to make it into some kind of tuned mass damper kind of thing which would have its own vibration and noise problems, because the sensors have finite mass too. Mounting any kind of mass on the end of a spring (flexible member) will cause it to behave like an oscillator at certain frequencies. But what I never thought deeply about was just how high a frequency that system would actually resonate at.

Consider for example a sensor board that weighs 5 grams and a block of foam that has a stiffness of 1400 N per meter. 1400 N/m is not unreasonable – McMaster’s softest polyurethane foam is rated at 25% deflection @ 1psi, and for a roughly 1 inch square, 1/4″ thick chunk that holds your sensor boards, the equivalent ‘spring constant’ is right around that number. The resonant frequency 1/sqrt(M / K) for that system is above 500 Hz, which is well over the  analog bandwidth of the IMU boards you can generally buy.  Visco-elastic materials like rubbers and foams also provide good *damping*, generally, so frequencies outside that one magic resonance tend to be well suppressed.  On Tinycopter, I filter everything at 12.5Hz anyway.

But what really made me remount the electronics on little wobbly silicone legs was a visitor from Boston University’s IML, where they have real quadrotors. He made the suggestion that I could potentially mount my entire electronics board on some soft tubing instead of hard aluminum standoffs bolted to the carbon fiber frame. Okay, that’s it – a real quadrotor guy just told me something, so it must be legit, right?

Tinycopter flew much better after this treatment, so much better that I could actually start tuning gains. Before that, there was no gain low enough that it wouldn’t stop just violently oscillating and randomly revving the props. My noise must have been on the same order of magnitude as my signal – and there is no (linear time invariant) filter which can get rid of that.

The other thing I did was sit patiently and wait for new propellers. By the end of that round of testing, Tinycopter’s props were 50% superglue and 50% Kapton tape – they were so unbalanced that those vibrations were beginning to cause handling problems.

I also moved the receiver on top of everything else. This isn’t a change that made a huge difference or anything, but beforehand, the wires coming out of the receiver were both in a precarious blade-strikable location and were pulling the receiver off its Velcro mount. The new mount is located on top of the Nano and the IMU and is made of some layers of double sided foam tape.

After that, it was a matter of gain tuning and some practice before Tinycopter could fly stably and with reasonable control. As can be seen in the demo video, it flies very well and exhibits very little oscillation in the air.

Well, it all went to hell after they handed it back to me:

That was the result of that ceiling plant. Nothing’s broken per se, besides one prop, but it does need to be straightened and reglued. I also received my smaller Hobbyking controllers (the smallest in stock at the time – 10A, still a tad overkill), so I may take this rebuild opportunity to put those on.

In the mean time, Tinycopter’s current Arduino sketch (which now does fly things!)

Can I make Ballcopter again now?!



Poor Tinycopter

Jan 05, 2012 in Project Build Reports, Tinycopter

Based solely on that title, you can probably guess that no it’s not working yet. Tinycopter has been reduced to a case like all of my controls projects: in software limbo. Unlike mechanical things, which either work or don’t, debugging software requires me to be a bit more methodical. It’s definitely almost there though!

To get Tinycopter flying before my Hobbyking order for small ESCs arrived, I decided to chop and repackage some larger controllers. They’re the 18A Turnigy Plush common on medium sized copters.

They weigh about 20 grams or so with heavy 16ga wiring, the thick shrink wrap, and the aluminum heat spreader plate. Because I was going to use them for all of 3 amps or so, all of this was chopped.

With 20 gauge wires, thin shrink, no heat spreader, and a shortened servo cable, I got the boards down to 12 grams, which was good enough for now!

Given that the ESCs are roughly half the starting weight, I piled 2 of the stock ones onto Tinycopter to get an idea for final weight. It looks right on target – 200 or so grams with a massively oversized battery. Once the 370mAh ones arrive, it should be around 175-180 grams.

With everything fitted out, I took off the props first and began constructing the stability controller. I compartmentalized as much as I could and tested as I went along making sure every stage of the code was functioning. This pretty much took a whole day. Unlike Edgertoncopter, it wasn’t banged out quickly with inline functions and shady loop timing.

But Edgertoncopter works, and unlike Edgertoncopter, Tinycopter didn’t.

The result of the first free flight was immediate instability and explosion:

Well, at least it wasn’t as bad as the last instability resulting in explosion.


After a whole evening of prop changing, loop tuning, and optimization, Tinycopter is pretty well scarred.

And it still doesn’t fly stably – it enters a slow but increasingly divergent oscillation, almost as if something is lagging or being too slow in responding. This resulted in a few hours of tearing my hair out trying different gains.

But I know exactly why now, and I’m going to fix it first thing tomorrow. This time, I actually did the software correctly, and the real problem is far worse.

the real result of this experiment

Here, have a look at its version 1 sketch. Note that this will not fly anything yet – there are some fundamental issues in the code, but…

The real result of this whole build is that Tinycopter does not use XBypass.

As quickly as I threw together that hack, it was superceded. Tinycopter uses, instead, the pin change interrupt and timing method first outlined in the XBypass post, but augmented by commenter beak90′s code contribution. I implemented the PinChangeInt library version 1.3, and am glad to say it works extremely well. The resolution given by the built-in timer (micros()) is 4 microseconds, which is reasonable for controlling things, giving approx. 250 discrete steps in the R/C servo pulse width band.

I will probably recommend this method over pulseIn() for all but the most basic servo reads. It’s easy to set up, does not require caressing the ATmega328 manual, and works great.

The overhead introduced by my code and the PinChangeInt’s natural overhead seems to be around 25 to 30 microseconds, which… honestly, taking a 60us chunk  (one falling and one rising edge for subsequent channels) out of the code periodically every 1000 to 2000 is much, much better than several tens of thousands. My control loop code seems to complete in about 900uS – I set a pin high when it starts and low again when it falls, and it forms a neat almost-50% square wave at 500Hz. It takes a while because of the dozen or so floating point operations it has to shove through.




Revenge of the Quadrotor

Jan 02, 2012 in Project Build Reports, Tinycopter

I knew I couldn’t leave it for long.

Born of the wreckage of the Deathcopter, kind of like a carbon fiber and superglue phoenix which is not on fire (yet), is a brand new quadrotor! Introducing tinycopter:

It’s 99% less likely to kill me! Yay!

I pitched this frame together in a little under 4 hours with borrowed 4pcb parts and absolutely no planning beforehand. That means it should work perfectly when I wire everything up.

I began the process of scrapping the big frame after determining that using the two battery struts, which are square, would let me build a pretty sturdy combination motor mount and frame. I have still yet to test the two remaining fans – should they prove to be structural, maybe I’ll build something silly and fan powered again (or maybe an Avatar Gunship or something).

The IMU and Arduino Nano were recovered from the 2.007 carrier (which will see service in another vehicle some day) for Tinycopter.

From the mass of quadrotor parts Shane purchased, I’m going to use the Hobbyking 10 gram motors and 5×3 propset (which were too big for 4PCB). Conveniently the 10g motors also have a cross shaped flange base, of which I will use two of the mounting holes.

I drew up a quick Solidworks sketch of where the mounting holes should be, and then made both struts in series using the mill’s X axis for positioning.

There is a “log cabin” joint (I am completely not sure of what the actual name of this is) in the middle of the carbon fiber rod that I just milled in the same setup. This allows the “X” to have a contiguous flush surface, so I don’t have to make any strangely shaped adapters in the middle. The four sets of holes near the center are for mounting electronics and accessories.

The joint is very tight-fitting, so I wicked some ultra-thin CA into it to keep the struts together.

All together!

I spent a few minutes investigating different ways to assemble the 10 gram motors and props. While it comes with a prop saver type hub, it is terrible.

Okay, so the hub itself is pretty okay. The props, however, are garbage. Not only are they totally off balance (kapton tape is visible on them to correct for the imbalance – the worst one needs almost an entire leading edge full of them!), but the hubs are not level – they have sprue bits hanging off them requiring a bit of knifework, and the bore on the correct side of the prop to use with the prop saver is very loose and sloppy. The rubber band that forms the prop saver mechanism is also fairly loose, and I’m not keen on it flying off.

So I turned the whole thing upside down and used the prop saver ring to sandwich the prop against the motor face. Nothing’s being saved any more, but it’s way more solid.

Title image again! I quickly whipped up an electronics mount out of some perfboard. 1″ tall 2-56 standoffs, actually 4pcb’s spare landing gear, make up the electronics mount. The standoffs are flexy-CA-glued to the carbon fiber, since I could not get 2-56 threads to hold in the material. The electronics board will be very simple – just the Nano, the 6 axis Razor IMU, and some headers.  5 volt logic power will be supplied by the motor controllers directly.

I currently do not have a matched set of 4 tiny motor controllers, but they should exist (either found or shipped) by the end of the week. I’m planning on using some 6 or 9 gram controllers from either Hobbyking or equivalents from HobbyPartz, but that’s all contingent if some can be excavated on campus.

The battery will be a 2S or 3S, 480 or 500mAh pack. I was testing with a 3S pack and the motors seemed not to mind, but they produced far more thrust than I feel like was warranted – 100 grams or more per motor. However, I’d have to order 2S packs, since I don’t have any.  The plan is to have the battery, which is the heaviest single part, reside under the electronics deck. This keeps the center of gravity fairly high, and it should almost be inline with the props.

This is fully intentional: Intuition and urban legend both suggest that having a low center of gravity (defined as below the vertical center of thrust of the props) results in a more stable vehicle due to the pendulum effect. This is, however, actually not the case. The pendulum effect actually contributes more strongly to unstable oscillation the lower the center of gravity is. Ideally, the CG should be exactly in plane with the props such that inertial forces do not have a moment arm to affect the system, but this is practically difficult to achieve. In that case, it’s actually better to have it a little high, above the props.

Weird, huh? [1]

Tinycopter is going to be a bit chunky, since I still can’t grasp the idea that flying things need to be light. Without controllers, battery, receiver, or wiring, it weighs in at 100 grams. The battery should be about 50 grams, the controllers around 30 grams, and the receiver about 9 grams. So, the all-up weight of Tinycopter should be about 200g. I’m sure the battery can get smaller if I go ahead and order some packs (360mAh, 7.4v packs are usually around 30 grams).

Despite me just having sung its praise in the last post, XBypass will not be used on Tinycopter at first. Commenter beak90 has pointed me to the PinChangeInt library in Arduino, so I am going to try first to do that thing I described in the XBypass post with timers and pin change monitoring but without the ass of real software. This means Tinycopter will use a stock radio.

The electronics in Tinycopter have been positioned to use the “box” orientation, which I find a little more intuitive since I can think about it as some kind of flying robot. I’m used to driving robots on the ground, and my transmitter technique is definitely reflective of that. I should be able to make it ‘mode switch’ in software as needed.


No external t-nutting or support equipment yet, but it’s getting there.